我試圖使用maven-resources-plugin做一些使用copy-resources目標的過濾,然後運行到以下錯誤:maven-resources-plugin error使用copy-resources的目標:'resources','outputDirectory'丟失或無效
Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:copy-resources (default-cli) on project bar: The parameters 'resources', 'outputDirectory' for goal org.apache.maven.plugins:maven-resources-plugin:2.5:copy-resources are missing or invalid
找出問題,我創建了一個非常簡單的pom.xml,從http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html複製非常近逐字,運行它,並得到了同樣的錯誤。
我與
mvn resources:copy-resources
任何想法調用呢?這是測試pom.xml。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/extra-resources</outputDirectory>
<resources>
<resource>
<directory>src/non-packaged-resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
嗯,你是對的。謝謝 - 在Maven競爭力的道路上又邁出了一步。 –
只需要注意:在另一個階段調用pom中的目標是正確的,但通常不應該從外部運行非Maven生命週期目標! –
@ childno.de是什麼讓你這麼說?這是不正確的Imho。 –