我在做什麼不正確的處理JBoss的Nexus存儲庫的這個問題?爲什麼Maven會從settings.xml中指定的不同Nexus repo下載依賴項?
我正在嘗試構建JBoss AS7並通過內部Nexus代理服務器代理JBoss公共存儲庫組。我希望通過我的Nexus回購代理整個構建代碼 - 不會碰到jboss.org Nexus回購站。但是,我遇到了一個問題。
一切構建好,直到是時候測試jboss-as-jmx,因爲它想要從附加回購下載工件... /開發人員組。
我在日誌中發現它會嘗試這樣的:
Downloading artifact org.jboss.as:jboss-as-jmx:jar:7.1.2.Final from jboss-developer (http://repository.jboss.org/nexus/content/groups/developer/, releases+snapshots)
所以我添加的jboss-開發商回購ID到我的Nexus指向http://repository.jboss.org/nexus/content/groups/developer,並把它添加到我的代理JBoss的公共組。然而,這似乎並沒有覆蓋的jboss-開發商回購和Maven仍嘗試從jboss.org
這裏下載神器試驗階段的有問題的日誌輸出:
T E S T S
-
Forking command line: /bin/sh -c cd "/opt/jenkins/jobs/JBoss AS7/workspace/jmx" && /usr/java/jdk1.7.0_05/jre/bin/java -Duser.region=US -Duser.language=en -jar '/opt/jenkins/jobs/JBoss AS7/workspace/jmx/target/surefire/surefirebooter6443418663635953999.jar' '/opt/jenkins/jobs/JBoss AS7/workspace/jmx/target/surefire/surefire6887873281987795093tmp' '/opt/jenkins/jobs/JBoss AS7/workspace/jmx/target/surefire/surefire5481790486559149986tmp'
Running org.jboss.as.jmx.model.LegacyTypeConverterUnitTestCase
Tests run: 49, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.389 sec
Running org.jboss.as.jmx.model.ExpressionTypeConverterUnitTestCase
Tests run: 46, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.143 sec
Running org.jboss.as.jmx.model.NameConverterUnitTestCase
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running org.jboss.as.jmx.model.ObjectNameAddressUtilTestCase
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.jboss.as.jmx.JMXSubsystemTestCase
Resolving artifact org.jboss.as:jboss-as-jmx:jar:7.1.2.Final
Downloading artifact org.jboss.as:jboss-as-jmx:jar:7.1.2.Final from jboss-developer (http://repository.jboss.org/nexus/content/groups/developer/, releases+snapshots)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Downloading: http://repository.jboss.org/nexus/content/groups/developer/org/jboss/as/jboss-as-jmx/7.1.2.Final/jboss-as-jmx-7.1.2.Final.jar
org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact org.jboss.as:jboss-as-jmx:jar:7.1.2.Final from/to jboss-developer (http://repository.jboss.org/nexus/content/groups/developer/): Error transferring file: Connection timed out from http://repository.jboss.org/nexus/content/groups/developer/org/jboss/as/jboss-as-jmx/7.1.2.Final/jboss-as-jmx-7.1.2.Final.jar
這裏是我的本地〜/ .m2/settings.xml - 所有其他依賴項工件已由此代理,直到此階段。它仍然不會覆蓋Maven試圖從http://repository.jboss.org下載這個依賴關係,即jboss-as-jmx。
<settings>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://repository.mycompany.com:8080/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>jboss-public-repository-group</id>
<url>http://jbosspublic</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>jboss-developer</id>
<url>http://jbosspublicdev</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
<pluginRepository>
<id>jboss-public-repository-group</id>
<url>http://jbosspublic</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
<pluginRepository>
<id>jboss-developer</id>
<url>http://jbosspublic</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</proxies>
</settings>
更新1:
當我運行mvn幫助:有效-POM我看到這個片段
<distributionManagement>
<repository>
<id>jboss-releases-repository</id>
<name>JBoss Releases Repository</name>
<url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
這一個:
<jboss.releases.repo.url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</jboss.releases.repo.url>
<jboss.snapshots.repo.url>https://repository.jboss.org/nexus/content/repositories/snapshots/</jboss.snapshots.repo.url>
這是奇怪的,因爲我知道所有其他工件都從我的內部nexus代理回購下載OK。接下來我要嘗試的是將這些添加到我的/.m2/settings.xml中
你已經在你的'pom.xml'配置的過JBoss的倉庫看看source code? – Augusto
它也可以在任何依賴項pom.xml文件中。你能看到你的機器上的瀏覽器中的jboss-as-jmx文件在nexus repo網址嗎? –
我已經從基本模塊pom.xml中刪除了JBoss存儲庫。其實嘗試了各種各樣的東西,如URL替換等無濟於事。 –