pom.xml Maven构建中出错

Chi*_*rag 4 eclipse m2eclipse maven

在尝试构建maven项目时,我的pom.xml中出现错误.错误在这个插件上:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
Run Code Online (Sandbox Code Playgroud)

这是Eclipse显示的错误:

Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:
 2.3.2:compile (execution: default-compile, phase: compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: 
 PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not 
 be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 (): 
 ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-toolchain:jar:1.0: 
 ArtifactResolutionException: Failure to transfer org.apache.maven:maven-toolchain:pom:1.0 from http://repo.maven.apache.org/
 maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or 
 updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-toolchain:pom:1.0 from/to central (http://
 repo.maven.apache.org/maven2): The operation was cancelled.
Run Code Online (Sandbox Code Playgroud)

ald*_*eal 9

似乎解决方案失败了.

使用该-U标志运行mvn 以忽略缓存并重新尝试解析

(alt + f5对话框也可能有帮助)


Seb*_*anH 7

当我遇到这个问题时,我发现这是由于以前的网络问题.本地Maven存储库避免立即重新尝试.解决此问题的最佳方法是使用eclipse"更新Maven项目"(ALT + F5)功能结束检查"强制更新快照/版本"选项.