Question

Is there a way to release only some artifacts from a Nexus staging repository?

I'm using Maven release plugin to push the artifacts to a Nexus pro staging repository. Then the QA team takes over, and I release the staging repository from the web interface once they are done.

The QA team is getting the jars from the staging repository, and they need the sources jars for the tests.

When I release the content from the staging to the release repository, I do not want to release the source jars.

Is there a way to release only some of the items in the Nexus staging repository?

Right now I'm deleting the source jars manually from the release repository after I promoted it. I had a few near misses, almost deleting the wrong file...

Any help from a Nexus pro on the features of Nexus pro would be brilliant!

Thanks, Eyal

Était-ce utile?

La solution

I ended up running two different builds using Maven profiles.

<profiles>
    <profile>       
        <id>release</id>
        <properties>
            <release-repository-id>RELEASES</release-repository-id>
            <release-repository--url>nexus-server/nexus/service/local/staging/deploy/maven2/</release-repository--url>
        </properties>
    </profile>
    <profile>       
        <id>internal</id>
        <properties>
            <release-repository-id>INTERNAL</release-repository-id>
            <release-repository--url>nexus-server/nexus/content/repositories/INTERNAL</release-repository--url>
        </properties>
    </profile>
</profiles>

then I used these properties in the distribution management section

<distributionManagement>
    <repository>
        <id>${release-repository-id}</id>       
        <url>${release-repository--url}</url>
    </repository>
</distributionManagement>

In this manner, running "mvn release:prepare -Prelease" and "mvn release:prepare -Pinternal" delivered the artifacts to the respective repositories.

These build steps execute on the same checkout working copy, so I get an identical revision for all the build artifacts.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top