0

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

Eyal Azran
  • 379
  • 1
  • 3
  • 14
  • you could create two staging repos, one for artifacts the other for sources. Another option is keep sources and binaries together in Nexus and selectively mirror what you want to expose to customers post-release. – Mark O'Connor May 19 '13 at 20:01
  • That sounds like a great solution. I'm using Maven release plugin to push the artifacts to Nexus. Is it possible to "split" the deployment into two staging repositories with one run? I need to have both the jar and the sources with the same revision number. (i.e. without rebuilding the code) – Eyal Azran Jun 13 '13 at 08:40
  • Might be tricky to do with the Maven release plugin. Normally sources are additional artifacts attached to the same Maven module, so the Maven release plugin would push both files. – Mark O'Connor Jun 13 '13 at 18:02

1 Answers1

1

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.

Eyal Azran
  • 379
  • 1
  • 3
  • 14