简体   繁体   中英

Maven Nexus private repository access

I have just set up a nexus repository in my local network. This repository exposes access to the Maven central repository, plus three different private hosted repositories: snapshot , release and ext3rdparty . All these repositories are part of the public group in nexus, which I use as a central access point for all repositories:

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

My problem is : Using NetBeans as development envirnment, I can access to all repositories except the 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.

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.

Here is the FULL content of my settings.xml to redirect maven to my own repository:

<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:

        <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...

Don't really know what was the problem here, but at least the pom and the settings were OK. Thanks for your help.

Did you add your ext3rdparty repo to your public group?

公共回购配置

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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