作爲我的pom.xml的一部分,我將一些額外的資源複製到目標目錄,如下所示。執行副本資源時出現「The PluginDescriptor not found」錯誤maven-resources-plugin的目標
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>copy-package-doc</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/package/${project.artifactId}-${project.version}/doc</outputDirectory>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>doc</nonFilteredFileExtension>
</nonFilteredFileExtensions>
<resources>
<resource>
<directory>doc</directory>
<filtering>true</filtering>
<includes>
<include>**/*.doc</include>
</includes>
<excludes>
<exclude>**/~*.doc</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-package-config</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/package/${project.artifactId}-${project.version}</outputDirectory>
<resources>
<resource>
<directory>config</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
當我打包神器,我得到錯誤:
The PluginDescriptor for the plugin org.apache.maven.plugins:maven-resources-plugin was not found. Should have been in realm: ClassRealm[/plugins/org.apache.maven.plugins:maven-resources-plugin:[email protected]/thread:Worker-17, parent: null]
如何解決呢?爲什麼我得到這個錯誤?
感謝, 拉法爾
切換到2.3版在我的情況下是無效的解決方案。在將問題發佈到StackOverflow之前,我已經嘗試過了。我無法檢查「mvn package -U -e」,因爲我已經移動到M2Eclipse,所以問題不存在。 – Rafal 2009-11-02 19:51:23