gpt4 book ai didi

java - pom.xml 有效,但代理设置不起作用?

转载 作者:行者123 更新时间:2023-12-01 11:08:33 26 4
gpt4 key购买 nike

我有一个可以在 AWS 上运行的 pom.xml,但在工作中的代理后面却不能运行。我已经尝试了这篇文章中的所有内容Maven proxy settings not working但没有任何效果。

这是使用 mvn help: effective-settings 的错误

...
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
Downloading:https://repo.maven.apache.org/maven2/org/codehaus/mojo/mavenmetadata.xml
Downloading:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xmlfrom/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xmlfrom 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 metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml fromhttps://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 updatesare forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
...
[ERROR] No plugin found for prefix 'help' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\David.Wynter\.m2\repository),central(https://repo.maven.apache.org/maven2)] -> [Help 1]

这是我的settings.xml的相关部分

<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>10.***.0.60</host>
<port>8080</port>
<username>dmgp\david.blow</username>
<password>*******</password>
<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>
</proxies>

主机等的设置来自适用于浏览器的 pac 文件。有什么想法吗?

我也尝试添加这个

    <extensions>
<extension>
<!-- this extension is required by wagon in order to pass the proxy -->
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>2.2</version>
</extension>
</extensions>

到我的 pom.xml 并将该 jar 添加到我的 maven 安装 lib 目录中,但得到了这个

[ERROR]     Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-http-lightweight:2.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.wagon:wagon-http-lightweight:jar:2.2: Could not transfer artifact org.apache.maven.wagon:wagon-http-lightweight:pom:2.2 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 2]

最佳答案

您已配置为使用 http 代理,而 Maven 的输出告诉您它正在使用 https

关于java - pom.xml 有效,但代理设置不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32647698/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com