Is there a way for the maven universal wap server to work on linux / mac / windows?

Given the very poor documentation about scp / ssh and maven, I tried different approaches, mainly in two main categories: using scpexe wagon and scp wagon. Usually they work without problems on both linux and mac, but on Windows I never found a way to make it work on all machines.

scpexe (after installing full putty and adding to the path) - settings.xml configuration:

<server> <id>internal</id> <username>******</username> <password>*******</password> <configuration> <sshExecutable>plink</sshExecutable> <scpExecutable>pscp</scpExecutable> </configuration> </server> 

scp approach - settings.xml:

  <server> <id>internal</id> <username>*********</username> <password>*********</password> <configuration> <StrictHostKeyChecking>ask</StrictHostKeyChecking> </configuration> </server> 

I also tried to set StrictHostKeyChecking to no, but the security risks aside did not work on a specific machine.

Has anyone found a way to constantly use the internal ssh repository on all machines?

+8
java maven ssh scp jsch
source share
1 answer

the Maven SSH wagon uses JSch, a pure Java SSH implementation that works independently of the OS. (This may not have been the case when this question was originally submitted, but it is true now.) The Deploy Plugin documentation still contains a guide called Deploying Artifacts in an External SSH Command , but this approach is no longer needed.

Here is an example configuration that I successfully used to deploy through SCP in a Linux box from a Windows 7 system with Maven 3.0.4.

pom.xml :

 <?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>hello</groupId> <artifactId>hello</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>Hello</name> <build> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ssh</artifactId> <version>2.3</version> </extension> </extensions> </build> <distributionManagement> <repository> <id>my-ssh-repo</id> <url>scp://my.server.url/path/to/ssh-repo</url> </repository> </distributionManagement> </project> 

settings.xml :

 <settings> <servers> <server> <id>my-ssh-repo</id> <username>myUser</username> <password>myPass</password> </server> </servers> </settings> 
+10
source share

All Articles