views:

1361

answers:

8

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?

A: 

The Maven SourceForge plug-in does not work with Maven 2. Also I believe this plug-in uses FTP which is no longer supported.

bmatthews68
+2  A: 

It looks like I am going to have to write this myself.

https://sourceforge.net/projects/wagon-sf/

bmatthews68
A: 

I found that CruiseControl can upload releases to SFEE and also works with Maven and Maven2

binco
+5  A: 

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>
Rich Seller
+1  A: 

After trying this a number of times, I finally got it to work -- with sftp not scp. This should work from a unix box (or Mac) -- I'm not sure about sftp clients for Windoze. I am using mvn version 2.2.0 and I don't think I have any special plugins installed. This deploys the various mvn packages to the Files section of my project page.

You'll need to change the following in your settings to get it to work:

  • user -- replace with your sourceforce username
  • secret -- replace with your password
  • ormlite -- replace with your project name
  • /o/or/ -- replace with the first char and first 2 chars of your project name

In my $HOME/.m2/settings.xml file I have the following for the SF server:

<server>
  <id>sourceforge</id>
  <password>secret</password>
  <filePermissions>775</filePermissions>
  <directoryPermissions>775</directoryPermissions>
</server>

I don't specify the username in the settings.xml file because it needs to be username,project and I want to deploy multiple packages to SF. Then, in my pom.xml file for the ormlite package I have the following:

<distributionManagement>
 <repository>
  <id>sourceforge</id>
  <name>SourceForge</name>
  <url>sftp://user,[email protected]:/home/frs/project/o/or/ormlite/releases
  </url>
 </repository>
 <snapshotRepository>
  <id>sourceforge</id>
  <name>SourceForge</name>
  <url>sftp://user,[email protected]:/home/frs/project/o/or/ormlite/snapshots
  </url>
 </snapshotRepository>
</distributionManagement>

Obviously the /releases and /snapshots directory suffixes can be changed depending on your file hierarchy.

Gray
A: 

Where timp = user and webmacro = project

scp url does not work:

scp://timp,[email protected]:/home/groups/w/we/webmacro/htdocs/maven2/

sftp url works:

 sftp://timp,[email protected]:/home/groups/w/we/webmacro/htdocs/maven2

or for project release artifacts:

sftp://timp,[email protected]:/home/frs/project/w/we/webmacro/releases

scp will work to shell.sourceforge.net, but you have to create the shell before use with

ssh -t timp,[email protected] create
TimP
+2  A: 

Hello all.

I have uploaded an example to sourceforge.net at: http://sf-mvn-plugins.sourceforge.net/example-1jar-thinlet/

You can check out it via svn - so you can see how to use plugins for upload and download of and to sourceforge.net file system area and web site.

The main points to upload are to use sftp:

Add this similar code to your pom.xml

<distributionManagement>
                <!-- use the following if you're not using a snapshot version. -->
                <repository>
                    <id>sourceforge-sf-mvn-plugins</id>
                    <name>FRS Area</name>
                    <uniqueVersion>false</uniqueVersion>
                    <url>sftp://web.sourceforge.net/home/frs/project/s/sf/sf-mvn-plugins/m2-repo</url>
                </repository>
                <site>
                    <id>sourceforge-sf-mvn-plugins</id>
                    <name>Web Area</name>
                    <url>
                        sftp://web.sourceforge.net/home/groups/s/sf/sf-mvn-plugins/htdocs/${artifactId}
                    </url>
                </site>
</distributionManagement>

Add similar code to settings.xml

   <server>
      <id>sourceforge-sf-mvn-plugins-svn</id>
      <username>tmichel,sf-mvn-plugins</username>
      <password>secret</password>
    </server>

    <server>
      <id>sourceforge-sf-mvn-plugins</id>
      <username>user,project</username>
      <password>secret</password>
    </server>

The main point for download is to use the wagon-http-sourceforge maven plugin - please see at: sf-mvn-plugins.sourceforge.net/wagon-http-sourceforge/FAQ.html

Please add the following code to your pom.xml

    <repositories>
        <repository>
            <id>sourceforge-svn</id>
            <name>SF Maven Plugin SVN Repository</name>
            <url>http://sf-mvn-plugins.svn.sourceforge.net/svnroot/sf-mvn-plugins/_m2-repo/trunk&lt;/url&gt;
        </repository>
    </repositories>


    <pluginRepositories>
        <pluginRepository>
            <id>sourceforge-frs</id>
            <name>SF Maven Plugin Repository</name>
            <url>http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo&lt;/url&gt;
        </pluginRepository>
    </pluginRepositories>

    <build>
    <extensions>
        <extension>
            <groupId>net.sf.maven.plugins</groupId>
            <artifactId>wagon-http-sourceforge</artifactId>
            <version>0.4</version>
        </extension>
    </extensions>
   :
   </build>
FunThomas424242