java - 插件 org.apache.maven.plugins :maven-compiler-plugin or one of its dependencies could not be resolved

标签 java eclipse maven maven-compiler-plugin

我在正确配置 eclipse 以使用 maven 时遇到了一些问题。

我创建了一个新项目,这个项目是在命令行中使用 maven 正确构建的(mvn install),但是在 Eclipse 中我得到了这个错误:

CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 (): ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-settings:jar:2.2.1: ArtifactResolutionException: Failure to transfer org.apache.maven:maven-settings:pom:2.2.1 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-settings:pom:2.2.1 from/to central : NullPointerException pom.xml /test line 9 Maven Project Build Lifecycle Mapping Problem

这是我的 settings.xml 配置文件:

<proxy>
  <active>true</active>
  <protocol>http</protocol>
  <username>myuser</username>
  <password>$mymdp</password>
  <host>myhost</host>
  <port>8080</port>
  <nonProxyHosts>some.host.com</nonProxyHosts>
</proxy>
....

<repository>
     <id>central</id>
     <name>central repo m2</name>
     <url>http://central.maven.org/maven2</url>
</repository>

我选择了正确的 maven 安装(在 Preference -> Maven -> Install 中)

我还将我的用户设置指向正确的 settings.xml(首选项 -> Maven -> 用户设置)

但我在 Eclipse 中仍然遇到此错误,并且使用 maven 命令行一切正常。你有想法吗?

最佳答案

您只需删除一个出现错误的文件夹。只需转到您的 M2 存储库和 org/apache/maven/plugins/maven-compiler-plugins 并删除文件夹 2.3.2

关于java - 插件 org.apache.maven.plugins :maven-compiler-plugin or one of its dependencies could not be resolved,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21579247/

相关文章:

git - 项目 + 每个开发人员 nbactions.xml?

java - 如何让 Chronometer 在 Android 中用作倒计时器?

java - 错误消息 'Cannot be resolved or is not a field'

java - 如何将 Maven 管理的依赖项复制到 war\web-inf\lib 中,以便我可以在 Eclipse 中以 Debug模式运行我的 GWT 2.0 应用程序?

xml - 使用 Maven 解析 JUnit 结果 XML 格式(由第 3 方工具创建)

java - 如何在 Travis-CI 中跳过 Java Maven 项目的 gpg 签名

java - 将可写对象添加到 Hadoop 配置

java - 将背景图像添加到包含其他组件的面板

java - 为什么 System.arraycopy 不是驼峰式?

java.lang.runtimeException 无法启动 Activity componentinfo java.lang.nullpointerException android