Maven deploy Plugin: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 15: Line 15:
<syntaxhighlight lang='xml'>
<syntaxhighlight lang='xml'>
<distributionManagement>
<distributionManagement>
<repository>
    <repository>
<id>nexus</id>
        <id>nexus</id>
<url>https://nexus-cicd.apps.openshift.novaordis.io/content/repositories/releases</url>
<url>https://nexus-cicd.apps.openshift.novaordis.io/content/repositories/releases</url>
</repository>
    </repository>
<snapshotRepository>
    <snapshotRepository>
<id>nexus</id>
        <id>nexus</id>
<url>https://nexus-cicd.apps.openshift.novaordis.io/content/repositories/snapshots</url>
<url>https://nexus-cicd.apps.openshift.novaordis.io/content/repositories/snapshots</url>
</snapshotRepository>
    </snapshotRepository>
</distributionManagement>
</distributionManagement>
</syntaxhighlight>
</syntaxhighlight>
</font>
</font>

Revision as of 11:09, 9 December 2017

External

Internal

Overview

The deploy plugin copies artifacts into a remote repository (the install plugin copies artifacts into the local repository).

POM must contain a <distribution-management> element:

<distributionManagement>
    <repository>
        <id>nexus</id>
	<url>https://nexus-cicd.apps.openshift.novaordis.io/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
        <id>nexus</id>
	<url>https://nexus-cicd.apps.openshift.novaordis.io/content/repositories/snapshots</url>
    </snapshotRepository>
</distributionManagement>

Running as Part of a Lifecycle

See:

The install plugin - Running as Part of a Lifecycle

Examples

Install Arbitrary Files as Binaries and Sources

mvn deploy:deploy-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B \
     -Dpackaging=jar -Dfile="C:\tmp\jta-1.0.1B.jar" \
     -Durl="file://C:\Documents and Settings\user1\.m2" -DrepositoryId=repository
mvn deploy:deploy-file -DgroupId=ec.template -DartifactId=test -Dversion=1 -Dpackaging=zip \
   -Dfile=./test.zip -Durl=https://username:mypasswd@example.com/nexus/content/repositories/libs-release-local/blah

This will create (with appropriate permissions) https://example.com/nexus/content/repositories/libs-release-local/blah/ec/template/test/1/test-1.zip

Deploying Programmatically an Artifact under a Different Name than its artifactId

See:

install plugin - Deploying Programmatically an Artifact under a Different Name than its artifactId