2

尝试从命令行使用 Maven。已设置 setting.xml 代理 -

    <proxy> 
       <id>optional</id>
       <active>true</active>
       <protocol>http</protocol>
       <username></username>
       <password></password>
       <host>access.lb.xxx.org</host>
       <port>80</port>
       <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>

从 cmd 屏幕尝试运行命令 - mvn archetype:generate -X

出现错误,例如 -

    ...
    Caused by: org.sonatype.aether.transfer.ArtifactTransferException: 
    Could not transfer artifact org.apache.maven.plugins:maven-release-plugin:pom:2.0  
    from/to central (http://repo.maven.apache.org/maven2): Access denied to:     
    http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release   
    plugin/2.0/maven-release-plugin-2.0.pom, ReasonPhrase:Forbidden.
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap  
    (WagonRepositoryConnector.java:951) ...

无法确定代理设置是否正确?有没有办法通过代理?或者任何其他方式让我至少创建一个简单的 Maven 项目?

谢谢

4

0 回答 0