简体   繁体   English

Maven Nexus私人存储库访问

[英]Maven Nexus private repository access

I have just set up a nexus repository in my local network. 我刚在本地网络中建立了一个nexus存储库。 This repository exposes access to the Maven central repository, plus three different private hosted repositories: snapshot , release and ext3rdparty . 此存储库公开了对Maven中央存储库的访问,以及三个不同的私有托管存储库: snapshotreleaseext3rdparty All these repositories are part of the public group in nexus, which I use as a central access point for all repositories: 所有这些存储库都是nexus中公共组的一部分,我将其用作所有存储库的中央访问点:

http://nexus.server/nexus/content/groups/public/ HTTP://nexus.server/nexus/content/groups/public/

My problem is : Using NetBeans as development envirnment, I can access to all repositories except the ext3rdparty . 我的问题是 :使用NetBeans作为开发环境,我可以访问 ext3rdparty 之外的所有存储库。 ie i got a compilation error when I try to build projects which are based on libraries stored in the ext3rdparty repo, and NetBeans can't find / navigate any of the artifacts available in this repository. 即当我尝试构建基于存储在ext3rdparty repo中的库的项目时,我收到了编译错误,并且NetBeans无法找到/导航此存储库中可用的任何工件。

I suspect this is a settings.xml / pom.xml problem and not a NetBeans one because as I said, I can access to artifacts that I've released in other repositories, but I can't figure-out what's the problem. 我怀疑这是一个settings.xml / pom.xml问题而不是NetBeans问题,因为正如我所说,我可以访问我在其他存储库中发布的工件,但我无法弄清楚问题是什么。

Here is the FULL content of my settings.xml to redirect maven to my own repository: 以下是我的settings.xml的完整内容,用于将maven重定向到我自己的存储库:

<mirrors>
    <mirror>
        <id>nexus</id>
        <mirrorOf>*</mirrorOf>
        <url>http://nexus.server/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>
                    <updatePolicy>always</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                    <updatePolicy>always</updatePolicy>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>central</id>
                <url>http://central</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>always</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                    <updatePolicy>always</updatePolicy>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>nexus</activeProfile>
</activeProfiles>

<servers>
    <server>
        <id>nexus</id>
        <username>user</username>
        <password>***</password>
    </server>
    <server>
        <id>releases</id>
        <username>user</username>
        <password>***</password>
    </server>
    <server>
        <id>snapshots</id>
        <username>user</username>
        <password>***</password>
    </server>
</servers>

And here is the repositories-related part of my parent pom to allow deployment: 以下是我的父pom中与存储库相关的部分,以允许部署:

        <distributionManagement>
            <repository>
                <id>releases</id>
                <name>Releases</name>
                <url>http://nexus.server/nexus/content/repositories/releases/</url>
            </repository>

            <snapshotRepository>
                <id>snapshots</id>
                <name>Snapshots</name>
                <url>http://nexus.server/nexus/content/repositories/snapshots/</url>
            </snapshotRepository>
        </distributionManagement>

Any idea of what's wrong ? 什么是错的?

Thanks in advance! 提前致谢!

EDIT : 编辑

Half of a day lost: I finally ended up with removing all dependencies from the ext3rdparty repository, uploading them again to the repository, and updating all indexes and now everything works fine... 半天失去了:​​我终于最终从ext3rdparty存储库中删除了所有依赖项,再次将它们上传到存储库,并更新所有索引,现在一切正常......

Don't really know what was the problem here, but at least the pom and the settings were OK. 不知道这里有什么问题,但至少pom和设置都没关系。 Thanks for your help. 谢谢你的帮助。

Did you add your ext3rdparty repo to your public group? 您是否已将ext3rdparty回购添加到公共组?

公共回购配置

如果您遇到此类问题,可以右键单击“存储库”列表中受影响的存储库,然后激活“修复索引”或“更新索引”,然后在“系统源”中查看系统更新中的状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM