1

I am using maven-release-plugin 2.5.3 to perform a depoyment to my nexus repo as well as a third party repo, hence i am using profiles, my nexus profile is set up in settings.xml whereas the third party on pom.xml

For some reasons the releaseProfiles and -P options don't seem to work, I can only get one profile to update the repo. does anyone have an idea on how i can manage to deploy my artifacts to both repos at one time?

please seee below my config:

    <distributionManagement>
    <repository>
        <id>${repo-id}</id>
        <name>${repo-name}</name>
        <url>${repo-url}</url>
    </repository>
</distributionManagement>
   <profiles>
        <profile>
            <id>p1</id>
            <properties>
                <repo-id>X-xxxx-XX</repo-id>
                <repo-name>X Server</repo-name>
                <repo-url>https://x.thirdparty.co/x-artifacts/</repo-url>
            </properties>
        </profile>
          <profile>
            <id>nexus</id>
            <properties>
                <repo-id>X-xxxx-XX</repo-id>
                <repo-name>X Server</repo-name>
                <repo-url>https://x.x.co/x-artifacts/</repo-url>
            </properties>
        </profile>
    </profiles>

mvn release:clean release:prepare release:perform -B -P nexus,p1

I have tried also configuring the profiles on the pom but with no luck it's cleary a bug but i need a workaround to get my both repos updated.

When I run

mvn release:prepare -DdryRun=true help:active-profiles -P p1

I can see both profiles indicating as active.

How can i upload the artifacts to both repos?

tosi
  • 1,873
  • 2
  • 18
  • 38
  • Why do you need to deploy to two repositories? Just deploy to the 3rd party one, and create and configure that repo in Nexus http://stackoverflow.com/questions/13564180/deploying-maven-artifact-to-multiple-repositories-with-different-settings – Tunaki Mar 02 '17 at 19:39
  • Can you clarify what do you mean by "not working"? (like posting the stack trace) – Adonis Mar 02 '17 at 22:14
  • If you like to give arguments which should be used during the release than you need to defined them like this: `-Darguments="-Pnexus,p1"` – khmarbaise Mar 03 '17 at 07:00
  • what I mean by it's not working it's not invoking both profiles to upload the artifacts to two different repositories, it only does one of them. – tosi Mar 03 '17 at 10:31
  • Hey khmarbaise - I've tried doing that but no luck, here what I have org.apache.maven.plugins maven-release-plugin 2.5.3 deploy nexus,p1 -Pnexus,p1 – tosi Mar 03 '17 at 10:31
  • I even ran it as mvn release:clean release:prepare release:perform -DdryRun=false -B -Darguments="-Pnexus,p1" with no joy – tosi Mar 03 '17 at 10:32

0 Answers0