idea 创建maven项目一直失败,什么原因?build一直不行。。

发布于 2022-09-04 03:10:21 字数 3033 浏览 8 评论 0

    D:\software\jdk1.8.0_60\bin\java "-Dmaven.home=D:\software\idea\IntelliJ IDEA 2016.2.4\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\software\idea\IntelliJ IDEA 2016.2.4\plugins\maven\lib\maven3\bin\m2.conf" -Dfile.encoding=UTF-8 -classpath "D:\software\idea\IntelliJ IDEA 2016.2.4\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar" org.codehaus.classworlds.Launcher -Didea.version=2016.2.4 -s D:\software\apache-maven-3.3.9\conf\settings.xml -DinteractiveMode=false -DgroupId=com.salamander -DartifactId=backcal -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=RELEASE -DarchetypeCatalog=internal org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate
    [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Maven Stub Project (No POM) 1
    [INFO] ------------------------------------------------------------------------
    [INFO] 
    [INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom >>>
    [INFO] 
    [INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom <<<
    [INFO] 
    [INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom ---
    Downloading: http://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/1.8.3/groovy-1.8.3.jar
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 26.608s
    [INFO] Finished at: Fri Nov 04 13:57:08 CST 2016
    [INFO] Final Memory: 9M/155M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate failed: Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its dependencies could not be resolved: Could not transfer artifact org.codehaus.groovy:groovy:jar:1.8.3 from/to central (http://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:80 [repo.maven.apache.org/151.101.36.215] failed: Connection timed out: connect -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
    [ERROR] Maven execution term

inated abnormally (exit code 1)

一直build就出错。。。。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

筑梦 2022-09-11 03:10:21

错误不是说你下载http://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/1.8.3/groovy-1.8.3.jar没下载下来吗?配一个镜像吧。

傻比既视感 2022-09-11 03:10:21
<profiles>
    <profile>
        <id>aliyun</id>
        <repositories>
            <repository>
                <id>nexus</id>
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>admin</id>
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>aliyun</activeProfile>
</activeProfiles>

~/.m2/settings.xml中配置上面的镜像,速度刷...刷...刷...的。

诠释孤独 2022-09-11 03:10:21

一楼二楼双剑合璧

忆沫 2022-09-11 03:10:21

我用的也是阿里云的镜像,在setting.xml中添加mirror

  <mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>       
    </mirror>
  </mirrors>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文