3

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

For background information: I'm using tycho to build an Eclipse plugin and want to get the update site ( <packaging>eclipse-update-site</packaging>) uploaded.


Asked on the Tycho users list as well.

oberlies
  • 11,503
  • 4
  • 63
  • 110
Robert Munteanu
  • 67,031
  • 36
  • 206
  • 278

2 Answers2

10

I don't get why you couldn't use mvn deploy to deploy your eclipse-update-site artifact. So, this is my suggestion.

First, update your 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 into your ~/.m2/settings.xml:

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

And run mvn deploy.

Ravindranath Akila
  • 209
  • 3
  • 35
  • 45
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
  • Thanks for your answer. When deploying with Tycho I get the following results: all plugins are deployed as plain maven artifacts, with addition p2artifacts.xml and p2metadata.xml files and the update site is deployed as a jar containing the site.xml file. – Robert Munteanu Nov 30 '09 at 09:18
  • Hmmm... Actually, I'm not sure to get your comment. On top of that, I wonder if https://issues.sonatype.org/browse/TYCHO-258 is a blocking issue... – Pascal Thivent Nov 30 '09 at 09:30
  • Trying to do this, I get `Permission denied (publickey,password).`, can someone help? – birgersp Aug 29 '16 at 08:24
5

Like above's answer but instead of wagon-ssh-external one needs to use wagon-ssh otherwise you'll get an error saying that sftp URLs are not known.

rob
  • 83
  • 1
  • 6
  • 1
    Answers shouldn't reference other answers. Instead, either propose an edit to the other answer, or provide a new standalone answer by copying the relevant parts from other answers. – oberlies Apr 04 '13 at 11:45