Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I deploy artifacts from a Maven build to the SourceForge File Release System?

I am using SourceForge for some Open Source projects and I want to automate the deployment of releases to the SourceForge File Release System. I use Maven for my builds and the standard SFTP deployment mechanism doesn't seem to work unless you do some manual preparation work. I have come across some old postings on other forums suggesting that the only approach is to write a Wagon specifically for SourceForge.

Has anybody had any recent experience with this?

like image 465
Brian Matthews Avatar asked Aug 19 '08 16:08

Brian Matthews


1 Answers

I'm not able to test this to confirm, but I believe it is possible without writing any plugins.

You can deploy to SourceForge using SCP, and the maven-deploy-plugin can be configured to use SCP so it should work. You can also deploy your site to SourceForge via SCP.

You would configure the SourceForge server in your settings.xml to use a "combined" username with a comma separator. With these credentials:

SourceForge username: foo
SourceForge user password: secret
SourceForge project name: bar
Path: /home/frs/project/P/PR/PROJECT_UNIX_NAME/ 
    - Substitute your project UNIX name data for /P/PR/PROJECT_UNIX_NAME 

The server element would look like this:

<server>
  <id>sourceforge</id>
  <username>foo,bar</username>
  <password>secret</password>
</server>

And the distributionManagement section in your POM would look like this:

<!-- Enabling the use of FTP -->
<distributionManagement>
  <repository>
    <id>ssh-repository</id>
    <url>
scpexe://frs.sourceforge.net:/home/frs/project/P/PR/PROJECT_UNIX_NAME</url>
  </repository>
</distributionManagement>

Finally declare that ssh-external is to be used:

<build>
  <extensions>
    <extension>
      <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-ssh-external</artifactId>
       <version>1.0-alpha-5</version>
    </extension>
  </extensions>
</build>

If this doesn't work, you may be able to use the recommended approach in the site reference above, i.e. create a shell on shell.sourceforge.net with your username and project group:

ssh -t <username>,<project name>@shell.sf.net create

Then use shell.sourceforge.net (instead of web.sourceforge.net) in your site URL in the diestributionManagement section:

<url>scp://shell.sourceforge.net/home/frs/project/P/PR/PROJECT_UNIX_NAME/</url>
like image 133
Rich Seller Avatar answered Oct 20 '22 00:10

Rich Seller