执行mvn help:system一直超时build失败问题【已解决】
😀大家好!我是向阳🌞,一个想成为优秀全栈开发工程师的有志青年!
📔今天来说一说如何解决执行mvn help:system一直超时build失败问题。
由于Maven是好久以前安装的,版本有点低,所以今天我重新安装了一下,安装的是3.8.8版本的。
结果环境变量、本地仓库、setting配置都配好后,用管理员身份在终端执行mvn help:system后却显示一直failed失败,原因找不到仓库资源,超时了。
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-help-
plugin:3.2.0:system (default-cli) on project standalone-pom:
Execution default-cli of goal org.apache.maven.plugins:maven-help-
plugin:3.2.0:system failed: Plugin org.apache.maven.plugins:maven-
help-plugin:3.2.0 or one of its dependencies could not be resolved:
Could not transfer artifact ... Connect timed out
造成这样情况的原因是setting里面的镜像mirror仓库太杂了,建议把其他的全部清空,只留下阿里云的,再次执行就成功了。
下面是我的setting.xml配置文件。
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<!-- pluginGroups
| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
|-->
<pluginGroups>
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
-->
</pluginGroups>
<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
</proxies>
<!-- servers
| This is a list of authentication profiles, keyed by the server-id used within the system.
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|-->
<servers>
</servers>
<mirrors>
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
</settings>
——👦[作者]:向阳256
——⏳[更新]:2024.3.22
——🥰本人技术有限,如果有不对指正需要更改或者有更好的方法,欢迎到评论区留言。