Skip to content

Instantly share code, notes, and snippets.

@sarjsheff
Created April 14, 2021 09:37
Show Gist options
  • Select an option

  • Save sarjsheff/cf3b7424028ed69273ff675fe24ddea2 to your computer and use it in GitHub Desktop.

Select an option

Save sarjsheff/cf3b7424028ed69273ff675fe24ddea2 to your computer and use it in GitHub Desktop.
maven ssh repository
...
<repositories>
<repository>
<id>ssh-repository</id>
<url>scp://192.168.1.1/maven</url>
</repository>
</repositories>
<build>
<extensions>
<!-- Enabling the use of SSH -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>LATEST</version>
</extension>
</extensions>
</build>
...
...
<distributionManagement>
<repository>
<id>ssh-repository</id>
<url>scp://192.168.1.1/maven</url>
</repository>
</distributionManagement>
<build>
<extensions>
<!-- Enabling the use of SSH -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>LATEST</version>
</extension>
</extensions>
</build>
...
ssh-keygen -m PEM -f /home/sheff/.ssh/id_rsa.maven
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- ~/.m2/settings.xml -->
<servers>
<server>
<id>ssh-repository</id>
<username>root</username>
<privateKey>/home/sheff/.ssh/id_rsa.maven</privateKey>
</server>
</servers>
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment