"The PluginDescriptor not found" error when executing copy-resources maven-resources-plugin's goal
As part of my pom.xml I copy some extra resources to the target directory as follows.
<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>
When I package artifact I get error:
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:2.4.1@48/thread:Worker-17, parent: null]
How to fix that? Why I get this error?
Thanks, Rafal
Include info on version used for: eclipse, java, maven
Try running mvn package -U -e
and include output on pastebin.
Also try using another version of resources-plugin <version>2.3</version>
or why do you need 2.4.1
Sounds like you got a corrupted maven plugin
Try deleting the folder maven-resources-plugin
contained in .m2/repository/org/apache/maven
Or post (or include link to) whole error message
I've seen lots of similar issues on the web (e.g. in IDEA-16866, IDEADEV-24376, MIDEA-109 or this one about Eclipse/IAM which seems to be the closest). In all cases, this seems related to Maven Embedder.
I have actually no idea of the cause of the problem and have no better suggestion than to use the latest version of maven (2.2.1) if it's not the case and/or to try with previous versions of the maven-resources-plugin (2.3) to verify that this is not a regression.
If this doesn't work, go the Maven 2.x Resources Plugin Jira and open an issue.
I have switched from Q for Eclipse to M2Eclipse and this solved my problem.
精彩评论