我正在使用插件“copy-rename-maven-plugin”,它只是在配置文件内部执行,如果我尝试在配置文件外部使用它,它只是不会“检测到”,我确认使用 -X 选项在“构建计划”期间,未检测到配置文件之外的插件不会作为目标出现
我的 pom.xml 片段代码
内部简介
<profile>
<id>QUA</id>
<properties>
<db.jndi.path>java:comp/env/jdbc/QUA</db.jndi.path>
<log4j.appender>${log4commonappender}</log4j.appender>
<datasourceDD>QUA</datasourceDD>
<excludeserviceprofile></excludeserviceprofile>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>rename-file</id>
<phase>compile</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<sourceFile>${project.build.outputDirectory}/services-profile.xml</sourceFile>
<destinationFile>${project.build.outputDirectory}/services.xml</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
外部轮廓
<build>
<finalName>app1</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>rename-file</id>
<phase>compile</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<sourceFile>${project.build.outputDirectory}/services.xml</sourceFile>
<destinationFile>${project.build.outputDirectory}/services.xml</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
我该怎么做才能在配置文件之外使用此插件?
提前致谢。
最佳答案
插件必须在插件管理之外执行
关于java - 如果在配置文件内,则仅执行 Maven 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61633031/