将插件移动到父 pom
Moving plugins to parent pom
我有两个子 pom 和 1 个父 pom,我将公共依赖项移动到父 pom 并在设置相对路径后构建成功,现在我将公共插件移动到父 pom,它抛出一个错误,这是代码片段父 pom.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${dependency.plugin.version}</version>
<executions>
<execution>
<id>copy-test-license</id>
<goals>
<goal>copy</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.cerner.clover</groupId>
<artifactId>clover</artifactId>
<version>${clover.license.version}</version>
<type>license</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
<execution>
<id>copy-pre-site-license</id>
<goals>
<goal>copy</goal>
</goals>
<phase>pre-site</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.cerner.clover</groupId>
<artifactId>clover</artifactId>
<version>${clover.license.version}</version>
<type>license</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
错误是:
build.plugins.plugin.version' for org.apache.maven.plugins:maven-dependency-plugin must be a valid version but is '${dependency.plugin.version}'.
我了解到问题是由于未提及版本而造成的。如何解决?
检查你的父 pom 中是否有这样的东西:
<properties>
...
<dependency.plugin.version>your-plugin-version</dependency.plugin.version>
...
</properties>
我有两个子 pom 和 1 个父 pom,我将公共依赖项移动到父 pom 并在设置相对路径后构建成功,现在我将公共插件移动到父 pom,它抛出一个错误,这是代码片段父 pom.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${dependency.plugin.version}</version>
<executions>
<execution>
<id>copy-test-license</id>
<goals>
<goal>copy</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.cerner.clover</groupId>
<artifactId>clover</artifactId>
<version>${clover.license.version}</version>
<type>license</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
<execution>
<id>copy-pre-site-license</id>
<goals>
<goal>copy</goal>
</goals>
<phase>pre-site</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.cerner.clover</groupId>
<artifactId>clover</artifactId>
<version>${clover.license.version}</version>
<type>license</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
错误是:
build.plugins.plugin.version' for org.apache.maven.plugins:maven-dependency-plugin must be a valid version but is '${dependency.plugin.version}'.
我了解到问题是由于未提及版本而造成的。如何解决?
检查你的父 pom 中是否有这样的东西:
<properties>
...
<dependency.plugin.version>your-plugin-version</dependency.plugin.version>
...
</properties>