一个maven错误:org/apache/maven/shared/filtering/MavenFilteringException

电脑重启后不知道为啥eclipse中的maven不能用了,pom文件一直标红,报以下错误:

Execution default-cli of goal org.apache.maven.plugins:maven-resources-plugin:2.5:copy-resources failed: A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:copy-resources: org/apache/maven/shared/filtering/MavenFilteringException

-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-resources-plugin:2.5
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/admin/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar
urls[1] = file:/C:/Users/admin/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1

import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

但是在.m2下maven插件:maven-resources-plugin的确是存在的,而且版本号的确是2.5技术分享

解决办法,在pom文件中增加:

    <plugins>
        <plugin>  
   <groupId>org.apache.maven.plugins</groupId>  
   <artifactId>maven-resources-plugin</artifactId>  
   <version>2.4.3</version>  
   <configuration>  
       <encoding>utf-8</encoding>  
   </configuration>  
</plugin> 
    </plugins>

具体原因以后再查。

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。