Internal Repository – Deploy artifacts with SSH

Uploading to the repository

In the settings.xml file define the connection details for the remote repository (using the <server> tag)

  <privateKey>C:\Documents and Settings\Beppe\Application Data\SSH\UserKeys\</privateKey>

Enter the credentials of the user performing the SSH access (ensure the right privileges are assigned ), the full path to the private key (tag <privateKey>) and file/folder permissions as above (required to deploy the artifacts on the server).

Deploy the artifact

Finally deploy the artifact to the internal repository:

mvn deploy:deploy-file
-DgroupId=com.mycompany -DartifactId=myLib -Dversion=1.0.0 \
-DgeneratePom=true -Dpackaging=jar -Dfile=target/mylib.jar \
-DrepositoryId=ssh-repository -Durl=scp://

The deploy command will upload the artifact to the internal repository generating the pom.xml descriptor according to the command line parameters.

Using the IDE

To deploy the artifact from within the Java IDE (instead of using command line) add the following to the pom.xml

    <name>Repository for Maven artifacts</name>

You can then run the deploy goal from within the IDE.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: