本文介绍了pom.xml中的错误Maven构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am getting an error in my pom.xml when trying to build a maven project. The error is here on this plugin:

      <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>

这是Eclipse显示的错误:

This is the error Eclipse shows:

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.


推荐答案

似乎解决方案失败。

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

Run mvn with the -U flag to disregard the cache and re-attempt resolution

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

(the alt+f5 dialog might help as well)

这篇关于pom.xml中的错误Maven构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 07:04
查看更多