使用 Nexus 设置缺少 Maven 依赖项

发布于 2024-09-19 07:15:12 字数 1648 浏览 10 评论 0原文

我正在尝试构建一个 Maven 项目来测试一些测试软件 - Arquillian。

我设置了 nexus 并将 jboss 存储库添加到公共组的底部。

当我运行 mvn test 时,我收到此错误:

Missing:
----------
1) com.sun.istack:istack-commons-runtime:jar:1.1-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun.istack -DartifactId=istack-commons-runtime -Dversion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.sun.istack -DartifactId=istack-commons-runtime -Dversion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) org.jboss.arquillian.sandbox.showcase:arquillian-sandbox-showcase-jsf:jar:1.0.0-SNAPSHOT
        2) org.jboss.jbossas:jboss-as-client:pom:6.0.0.20100721-M4
        3) org.jboss.jbossas:jboss-as-iiop:jar:client:6.0.0.20100721-M4
        4) org.jboss.jbossts:jbossjts:jar:4.11.0.Final
        5) org.jboss.ws.native:jbossws-native-core:jar:3.3.0.CR1.SP2
        6) com.sun.xml.ws:jaxws-rt:jar:2.2
        7) com.sun.xml.ws:policy:jar:2.0-b01
        8) com.sun.istack:istack-commons-runtime:jar:1.1-SNAPSHOT

我检查了 java.net maven 2 存储库,它肯定是 那里

但是,当我导航到本地 Nexus 公共群组时,它不在那里。

我该如何解决这个问题?这个问题的原因是什么? 我对此感到很困惑,因为我更习惯使用 ant+ivy。

mvn 的完整输出位于此处

I am trying to build a maven project to test out some testing software - Arquillian.

I setup nexus and added the jboss repositories to the bottom of the public group.

When i run mvn test i get this error:

Missing:
----------
1) com.sun.istack:istack-commons-runtime:jar:1.1-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun.istack -DartifactId=istack-commons-runtime -Dversion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.sun.istack -DartifactId=istack-commons-runtime -Dversion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) org.jboss.arquillian.sandbox.showcase:arquillian-sandbox-showcase-jsf:jar:1.0.0-SNAPSHOT
        2) org.jboss.jbossas:jboss-as-client:pom:6.0.0.20100721-M4
        3) org.jboss.jbossas:jboss-as-iiop:jar:client:6.0.0.20100721-M4
        4) org.jboss.jbossts:jbossjts:jar:4.11.0.Final
        5) org.jboss.ws.native:jbossws-native-core:jar:3.3.0.CR1.SP2
        6) com.sun.xml.ws:jaxws-rt:jar:2.2
        7) com.sun.xml.ws:policy:jar:2.0-b01
        8) com.sun.istack:istack-commons-runtime:jar:1.1-SNAPSHOT

I checked the java.net maven 2 repository and it is definately there.

However when i navigate to my local nexus public group, it is not there.

How can i solve this problem? And what is the cause of this problem? I am in way over my head with this, as I am more accustomed to using ant+ivy.

The full output from mvn is here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

∞琼窗梦回ˉ 2024-09-26 07:15:12

我显然也遇到了完全相同的问题。我解决了。
就我而言,问题是托管 istack-common-runtime-1.1.0-SNAPSHOT 的存储库在配置的 nexus 代理存储库中被标记为“release”。因此,nexus 忽略了该存储库中的所有快照。
我刚刚配置了另一个代理存储库,指向包含 istack-common-runtime-1.1.0-SNAPSHOT 的同一存储库,但在配置它时将其标记为“SNAPSHOT”。然后我将这个新代理添加到我的“SNAPSHOT”组中。

在我的 settings.xml 中,我在公共关系组上有一个存储库,在快照组上有另一个存储库:

<profiles>
    <profile>
        <id>nexus</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <id>release</id>
                <url>http://nexus-server/nexus/content/groups/public</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>snapshots</id>
                <url>http://nexus-server/nexus/content/groups/public-snapshots</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    </profile>
</profiles>

希望有帮助

I had apparently the exact same problem. I solved it.
In my case, the problem was that the repository that was hosting istack-common-runtime-1.1.0-SNAPSHOT was flagged "release" in the configured nexus proxy repo. So nexus was ignoring all snapshots in that repository.
I just configured another proxy repository pointing on the same one that contains istack-common-runtime-1.1.0-SNAPSHOT, but flagging it to "SNAPSHOT" when configuring it. I then added this new proxy to my "SNAPSHOT" group.

In my settings.xml, I have a repository on the public nexus group and another on the snapshots group :

<profiles>
    <profile>
        <id>nexus</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <id>release</id>
                <url>http://nexus-server/nexus/content/groups/public</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>snapshots</id>
                <url>http://nexus-server/nexus/content/groups/public-snapshots</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    </profile>
</profiles>

Hope this help

月牙弯弯 2024-09-26 07:15:12

如果您使用 Nexus Web 界面搜索它,它会显示吗?我在我们的 Nexus 安装中看到过这样的情况,其中一个工件看起来像这样丢失,但出现在搜索结果中。如果我随后通过浏览器从搜索结果中下载它,它就会神奇地开始在 Maven 命令行中工作。

我确信这不是您想听到的强大解决方案,但它至少值得一试。

Does it show up if you use the nexus web interface to search for it? I've seen cases in our nexus install where an artifact looks like it's missing like this, but shows up in the search results. If I then download it via my browser from the search results, it magically starts working at the maven command line.

Not the robust solution you want to hear, I'm sure, but it's at least worth a try.

愿得七秒忆 2024-09-26 07:15:12

如果您已将 JBoss 存储库添加到 Nexus,您是否记得配置公共存储库组以包含它?

这是屏幕截图:

alt text

If you've added the JBoss repository to Nexus, did you remember to configure your Public Repositories group to include it?

Here's a screenshot:

alt text

愿与i 2024-09-26 07:15:12

您是否位于公司防火墙后面?也许需要在 Nexus 中配置 HTTP 代理(请参阅服务器管理屏幕)

Are you behind a corporate firewall? Perhaps a HTTP proxy needs to be configured within Nexus (See the Server admin screen)

陌路终见情 2024-09-26 07:15:12

最终成为一种不良的依赖。我必须手动添加它才能使其正常工作。糟糕的!

Ended up being a bad dependency. I had to add it manually to get it all working. Terrible!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文