电脑重启后不知道为啥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>
具体原因以后再查。