当前位置: 首页 > 知识库问答 >
问题:

Maven代理设置不工作

弘思聪
2023-03-14

我在conf/settings.xml中将maven代理设置设置为

<proxy>
  <active>true</active>
  <protocol>http</protocol>
  <host>proxy.my-company.com</host>
  <port>8080</port>
</proxy>

但是当我运行maven build时,我得到了以下错误。有人能帮忙吗

[WARNING] The POM for org.apache.maven.wagon:wagon-ssh:jar:2.2 is missing, no dependency information available

详细日志

mvn -X

Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\tools\apache-maven-3.0.4
Java version: 1.6.0_12, vendor: Sun Microsystems Inc.
Java home: C:\tools\Java\jdk1.6.0_12\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"

[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\tools\apache-maven-3.0.4\conf\settings.xml
[DEBUG] Reading user settings from C:\Documents and Settings\desibaba\.m2\settings.xml
[DEBUG] Using local repository at C:\Documents and Settings\desibaba\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Documents and Settings\desibaba\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo.maven.apache.org/maven2 via proxy.my-company.com:8080 as null
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh/2.2/wagon-ssh-2.2.pom
[DEBUG] Writing resolution tracking file C:\Documents and Settings\desibaba\.m2\repository\org\apache\maven\wagon\wagon-ssh\2.2\wagon-ssh-2.2.pom.lastUpdated
[WARNING] The POM for org.apache.maven.wagon:wagon-ssh:jar:2.2 is missing, no dependency information available
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:2.2:
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.1:runtime
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo.maven.apache.org/maven2 via proxy.my-company.com:8080 as null
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh/2.2/wagon-ssh-2.2.jar
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[DEBUG] Writing resolution tracking file C:\Documents and Settings\desibaba\.m2\repository\org\apache\maven\wagon\wagon-ssh\2.2\wagon-ssh-2.2.jar.lastUpd
ated
[DEBUG] Writing resolution tracking file C:\Documents and Settings\desibaba\.m2\repository\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar.last
Updated
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-ssh:2.2 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven.wagon:wagon-ssh:jar:2.2, org.codehaus.plexus:plexus-utils:jar:1.1: Could not find artifact org.apache.maven.wagon:wagon-ssh:jar:2.2 in central (http://repo.maven.apache.org/maven2) @

        at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
        at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR]
[ERROR]   The project xxx (C:\t1\9630727\pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-ssh:2.2 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven.wagon:wagon-ssh:jar:2.2, org.codehaus.plexus:plexus-utils:jar:1.1: Could not find artifact org.apache.maven.wagon:wagon-ssh:jar:2.2 in central (http://repo.maven.apache.org/maven2) -> [Help 2]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.wagon:wagon-ssh:2.2 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven.wagon:wagon-ssh:jar:2.2, org.codehaus.plexus:plexus-utils:jar:1.1: Could not find artifactorg.apache.maven.wagon:wagon-ssh:jar:2.2 in central (http://repo.maven.apache.org/maven2)

共有1个答案

宇文鸣
2023-03-14

我不能用MVN3.0.4做到这一点,但我可以用3.0.3做到这一点

它似乎是3.0.4版本中的一个bug。

上面的jira条目为maven 3.0.4 bug提供了一个解决方案:添加

<build>
    <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>
</build>

这对我有效

 类似资料:
  • 我正在使用ApacheHttpClient库连接到url。我所在的网络有一个安全的代理。当我使用java时。net包连接到url我只需要添加 不需要传递代理用户ID和密码,但当我试图通过httpclient连接时,我收到了407代理身份验证错误。我的代码是: 代理正在使用NTML身份验证。我不想传递用户名和密码。

  • 我有一个在AWS上工作的pom.xml,但在代理工作的后面它没有。我已经尝试了这篇文章中的所有内容Maven代理设置都不起作用,但都不起作用。 以下是使用mvn帮助时的错误:有效设置 以下是my settings.xml的相关部分 主机等的设置来自适用于浏览器的pac文件。有什么想法吗? 我也试着添加这个 到我的pom。xml并将jar添加到我的maven install lib目录中,但得到了这

  • 我正在使用Mac的OSX 10.9.2并尝试使用NetBeans 7.2.1和Maven 3.1.1创建一个Maven项目 在NetBeans中,我在“首选项”中正确设置了代理设置- 在usr/local/apache-maven-3.1.1/conf/settings中。我正确设置了代理设置。 它在CLI中工作,当我下载存储库时,例如: 但是,如果我尝试在NetBeans中创建项目,它不起作用,

  • 我在POM. xml中引用了一个存储库来将ojdbc.jar添加到我的项目中,但是Maven(我使用STS插件)一直告诉我它找不到jar。 我在下面显示了我的存储库和jar依赖关系xml. 有人知道为什么找不到这个罐子吗?这是我的POM。xml设置不正确? 注意vaadin回购工作正常,因为vaadin罐被正确地添加到我的项目中。 下面是http://mvnrepository.com/artif

  • 我有一个来自3的Vue项目。十、 我在

  • 我正在使用Vue CLI 3.0。0(rc.10)和am并排运行两个服务器(后端服务器和WDS)。 我跟踪了devServer。Vue CLI文档中的代理说明,用于将代理选项添加到我的。我还按照http代理中间件库的说明补充了以下选项: 我的理解是,选项需要动态地将请求上的头更改为“http://localhost:4000“。但是,来自我的应用程序的请求仍从发送http://localhost: