Downloading a directory using sftp with Maven

How can I upload a directory - Eclipse update site - using sftp with public key authentication in Maven?

For reference: I use tycho to create an Eclipse plugin and want to download the downloaded update site ( <packaging>eclipse-update-site</packaging> ).


Also asked a question in the Tycho user list .

+3
source share
2 answers

I don’t understand why you could not use mvn deploy to deploy your eclipse-update-site artifact. So this is my suggestion.

First update the distributionManagement section:

 <!-- Enabling the use of FTP --> <distributionManagement> <repository> <id>update-site</id> <url>sftp://your/url</url> </repository> </distributionManagement> 

Then add the wagon extension for sftp:

 <build> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ssh</artifactId> <version>1.0-beta-6</version> </extension> </extensions> </build> 

Finally, add the credentials to your ~/.m2/settings.xml :

 <server> <id>update-site</id> <username>foo</username> <password>secret</password> </server> 

And run mvn deploy .

+10
source

As above, but instead of wagon-ssh-external, you need to use wagon-ssh, otherwise you will receive an sftp error message.

+5
source

All Articles