【问题标题】:Unable to create Maven project using eclipse Mars无法使用 Eclipse Mars 创建 Maven 项目
【发布时间】:2016-09-12 14:27:20
【问题描述】:

我是 Maven 设置的新手,在设置时面临挑战。当 eclipse 运行配置以设置 Maven 时,它会抛出如下错误:

CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from https://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.plugins:maven-compiler-plugin:pom:3.1 from/to central (https://repo.maven.apache.org/maven2): connect timed out

我完全可以手动下载https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/ 的资源,并且看不到理解连接定时错误。我已经清理了 .m2 文件夹并开始了新的 Maven 项目配置,但没有运气。另外,我在 .m2 文件夹中看不到 setting.xml。欢迎任何建议。提前致谢。

【问题讨论】:

    标签: eclipse maven selenium-webdriver maven-3 maven-assembly-plugin


    【解决方案1】:

    确保您的 Eclipse 连接是通过 Window -> Preferences -> Network Connections 设置的,

    同时检查窗口 -> 首选项 -> Maven -> 用户设置。如果指定了路径,例如“C:\Users\user.m2\settings.xml”,请确保它存在并正确填写,请尝试关注This Link

    【讨论】:

      【解决方案2】:

      确保您已从“项目->属性->Java 构建路径->库”添加所有外部 jar。 2)然后从'order and export tab->需要导出所有jar文件'。 3)然后确保您已从“pom.xml”文件中设置了所有依赖项。

      依赖关系

      <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>          
          <configuration>
              <source>1.7</source>
              <target>1.7</target>
      

      确保其最新的源和目标版本。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-07-08
        • 1970-01-01
        • 1970-01-01
        • 2010-10-11
        • 2012-02-02
        • 1970-01-01
        • 1970-01-01
        • 2016-06-25
        相关资源
        最近更新 更多