首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >插件org.apache.maven.plugins:maven-compiler-plugin或其依赖项无法解决。

问插件org.apache.maven.plugins:maven-compiler-plugin或其依赖项无法解决。
EN

Stack Overflow用户
提问于 2014-02-05 13:52:38
回答 7查看 183K关注 0票数 15

我有一些问题需要正确地配置eclipse来处理maven。

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

org.apache.maven.plugins:maven-compiler-plugin:3.1 :无法获得用于插件执行的参数compilerId的值- CoreException: PluginResolutionException: plugin CoreException或其依赖项之一无法解决:未能为org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 ()收集依赖项: ArtifactDescriptorException:未能读取org.apache.maven:maven-设置的工件描述符:jar:2.2.1: ArtifactResolutionException:未能传输org.apache.maven:maven-设置:pom:2.2来自.1的http://repo.maven.apache.org/maven2缓存在本地存储库中,在中央更新间隔已过或强制更新之前,将不会重新尝试解析。原始错误:无法将工件org.apache.maven: Maven -设置:pom:2.2.1从/转到central : NullPointerException pom.xml /test第9行Maven Project构建生命周期映射问题

这是我的settings.xml conf:

代码语言:javascript
复制
<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安装(首选-> Maven ->安装)

我还将用户设置定向到正确的settings.xml (Preferences -> Maven ->用户设置)

但是我在Eclipse中仍然有这个错误,而且maven命令行一切都进行得很好。你有想法吗?

EN

回答 7

Stack Overflow用户

回答已采纳

发布于 2014-03-13 08:19:29

您试过删除代理用户名和密码吗?一个类似的海报遇到了这一问题:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-jar-plugin:2.3.2 or one of its dependencies could not be resolved

未能做到这一点,我发现以下几点行之有效:

  1. 删除Eclipse中的项目(但不要删除磁盘上的内容)
  2. 删除Maven存储库中的所有文件
  3. 重新下载所有Maven依赖项:

mvn依赖:解决

  1. 启动Eclipse
  2. 确保Eclipse配置为使用外部Maven安装(窗口->Preferences->Maven->安装)
  3. 将现有项目重新导入Eclipse
  4. 确保在项目导入的最后屏幕上没有Maven Eclipse插件错误
票数 10
EN

Stack Overflow用户

发布于 2017-02-16 02:39:35

您只需要删除它正在抛出错误的一个文件夹。只需转到您的M2回购和M2,并删除文件夹2.3.2

票数 12
EN

Stack Overflow用户

发布于 2018-02-15 20:05:08

当使用IBMRSA9.6.1构建一台全新的开发机器时,我遇到了这个问题。对我来说,问题最终是由于Global存储库上的HTTPS。我的解决方案是创建一个Maven settings.xml,强制它使用HTTP。

对我来说,关键是当我在Maven存储库下爆炸时,中央存储库是空的-- >全局存储库

使用下列设置文件对我有效:

代码语言:javascript
复制
<settings>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>insecurecentral</activeProfile>
  </activeProfiles>
  <profiles>
    <profile>
      <id>insecurecentral</id>
      <!--Override the repository (and pluginRepository) "central" from the Maven Super POM -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://repo.maven.apache.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://repo.maven.apache.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
</settings>

I got the idea from this stackoverflow question.

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21579247

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档