pom.xml工作,但代理设置不起作用?

时间:2015-09-18 08:47:37

标签: java xml maven proxy

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

以下是使用mvn help的错误:有效设置

...
[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]

1 个答案:

答案 0 :(得分:1)

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