Skip to content

Instantly share code, notes, and snippets.

@basinilya
Last active January 30, 2018 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basinilya/70e741fb7fd5270c61cd92665cb73b6f to your computer and use it in GitHub Desktop.
Save basinilya/70e741fb7fd5270c61cd92665cb73b6f to your computer and use it in GitHub Desktop.
wagon-ssh
wagon-ssh requires patching settings.xml
mvn org.codehaus.mojo:wagon-maven-plugin::sshexec@execute-test-commands -Dssh.privateKey=C:/Users/basin/.ssh/id_rsa1 -Dssh.serverId=ssh-auth-pass -Dssh.username=joe -Dssh.password=s3cret
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>infloop</artifactId>
<version>0.1-SNAPSHOT</version>
<properties>
<aaa.bbb>basin</aaa.bbb>
</properties>
<pluginRepositories>
<pluginRepository>
<id>mojohaus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>apache-snapshots</id>
<url>https://repository.apache.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<!-- -->
</pluginRepositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<executions>
<execution>
<id>execute-test-commands</id>
<goals>
<goal>sshexec</goal>
</goals>
<configuration>
<serverId>${ssh.serverId}</serverId>
<url>scp://localhost</url>
<commands>
<command>pwd</command>
</commands>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.0.1-SNAPSHOT</version><!-- default is 2.11-SNAPSHOT -->
</dependency>
<!--
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interactivity-api</artifactId>
<version>1.0-alpha-6-basin-SNAPSHOT</version>
</dependency>
-->
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>ssh-auth-interactive</id>
<configuration>
<knownHostsProvider implementation="org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider">
<hostKeyChecking>no</hostKeyChecking>
</knownHostsProvider>
</configuration>
</server>
<server>
<id>ssh-auth-pass</id>
<username>${ssh.username}</username>
<password>${ssh.password}</password>
<configuration>
<knownHostsProvider implementation="org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider">
<hostKeyChecking>no</hostKeyChecking>
</knownHostsProvider>
</configuration>
</server>
<server>
<id>ssh-auth-pk</id>
<privateKey>${ssh.privateKey}</privateKey>
<passphrase>${ssh.passphrase}</passphrase>
<configuration>
<knownHostsProvider implementation="org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider">
<hostKeyChecking>no</hostKeyChecking>
</knownHostsProvider>
</configuration>
</server>
</servers>
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment