我正在從Maven 2遷移到Maven 3.我故意從消息和設置中刪除了主機和端口。Maven 3主機如何看起來與Maven 2不同?
Maven 2目前可以正常使用我們在防火牆後面設置的Artifactory中央存儲庫。當我切換到使用Maven 3它無法下載與該錯誤消息的插件:
[ERROR]插件org.apache.maven.plugins:行家安裝-插件:2.3.1或 一個其依賴關係無法解析:無法讀取組織的工件描述符 。 apache.maven.plugins:maven-install-plugin:jar:2.3.1:不能 轉移神器 org.apache.maven.plugins:maven-install-plugin:pom:2.3.1從/到 central( http:/ /:/ artifactory/plugins-release):Access denied to: http://:/artifactory/plugins-release/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven -install-plugin-2.3.1.pom ,ReasonPhrase:禁止。
這裏是我的設置:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<proxies>
<proxy>
<id>andy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxyip</host>
<port>80</port>
<username>user</username>
<password>password</password>
<nonProxyHosts>host</nonProxyHosts>
</proxy>
</proxies>
<servers>
<server>
<username>user</username>
<password>password</password>
<id>central</id>
</server>
<server>
<username>user</username>
<password>password</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://<host>:<port>/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://<host>:<port>/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://<host>:<port>/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://<host>:<port>/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
我已簽了正確的插件和版本artifactory的存在,這似乎是一個訪問問題。在配置需要更新的Maven 2和Maven 3之間有什麼變化?
我發現這是由於Maven 3試圖通過代理而不是本地網絡來查找主機而導致的。這意味着問題就變成了,Maven 3主機如何與Maven 2查找不同的內容? –