0

我在处理 JBoss 的 Nexus 存储库的这个问题时做错了什么?

我正在尝试构建 JBoss AS7 并通过内部 Nexus 存储库代理 JBoss Public 存储库组。我希望通过我的 Nexus 存储库代理整个构建 - 不访问 jboss.org Nexus 存储库。但是,我遇到了一个问题。

在测试 jboss-as-jmx 之前,一切都可以构建,因为它想从另一个 repo 下载工件...... /developer 组。

我在日志中注意到它尝试这样做:

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-developer repo id 添加到指向http://repository.jboss.org/nexus/content/groups/developer的 Nexus 中,并将其添加到代理的 JBoss Public 组中。但是,它似乎没有覆盖 jboss-developer 存储库,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 help:effective-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>

这很奇怪,因为我知道所有其他工件都可以从我的内部关系代理 repo 下载。接下来我将尝试将这些 s 添加到我的 /.m2/settings.xml

4

1 回答 1

1

下载这些依赖项是因为它们不是 Maven 构建的一部分,而是测试套件的一部分。其中 testsuite 动态加载以前版本组件的 maven 依赖项,以便它可以测试与以前版本的兼容性。

查看有关如何/在何处完成的源代码

于 2013-01-11T16:03:50.750 回答