views:

345

answers:

1

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.

+2  A: 

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-external</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.

Pascal Thivent
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
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