maven - maven中的多个代理设置

标签 maven

我是 Maven 的新手,我有一个疑问。是否可以在 maven 中配置多个代理?如果是这样怎么办?请举例回复。

我尝试通过在我的本地工作区中提供多个代理来找出它,但它没有用。我在任何地方都看不到正确的解释。请帮帮我。

最佳答案

请检查 Maven 站点 https://maven.apache.org/settings.html

如果您想添加多个代理,那么您需要在标签下添加所有代理。我能够添加多个代理并且它有效。

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                     http://maven.apache.org/xsd/settings-1.0.0.xsd">
 ...
 <proxies>
   <proxy>
    <id>myproxy</id>
    <active>true</active>
     <protocol>http</protocol>
     <host>proxy.somewhere.com</host>
     <port>8080</port>
    <username>proxyuser</username>
     <password>somepassword</password>
     <nonProxyHosts>*.google.com|ibiblio.org</nonProxyHosts>
    </proxy>
   <proxy>
    <id>myproxy</id>
    <active>true</active>
     <protocol>http</protocol>
     <host>proxy.example.com</host>
     <port>8080</port>
    <username>proxyuser</username>
     <password>somepassword</password>
     <nonProxyHosts>*.google.com|ibiblio.org</nonProxyHosts>
    </proxy>
 </proxies>
  ...
</settings>

关于maven - maven中的多个代理设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29604334/

相关文章:

java - 使用 maven 的带有 struts2、spring 和 JPA 的谷歌应用程序引擎

Maven 构建错误 : Error creating shaded jar (Access denied)

java - EAR 正在打包 WAR 和 JAR 项目的两个副本

java - 自动更新 Maven 依赖项

maven - 生成 Cobertura 覆盖率报告时,Hudson 构建失败并出现 NoClassDefFoundError

java - 无法使用 Maven 遮蔽 jar(INVOKESPECIAL/STATIC)

java.lang.NoClassDefFoundError : org/springframework/boot/Banner$Mode when using Hystrix

java - 依赖问题 : Java SE-1. 8、JUnit 5、Mockito 4.0 和 PowerMock

java - Intellij Maven 无法解决我的依赖关系

linux - Tesseract-OCR : Using Tess4j in spring mvc web application on linux environment