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

<p>Has anybody had any recent experience with this?</p>

[{'answer_id': 17779, 'author': 'Brian Matthews', 'author_id': 1969, 'author_profile': 'https://Stackoverflow.com/users/1969', 'pm_score': 0, 'selected': False, 'text': '<p>The Maven SourceForge plug-in does not work with Maven 2. Also I believe this plug-in uses FTP which is no longer supported.</p>\n'}, {'answer_id': 47220, 'author': 'Brian Matthews', 'author_id': 1969, 'author_profile': 'https://Stackoverflow.com/users/1969', 'pm_score': 2, 'selected': False, 'text': '<p>It looks like I am going to have to write this myself.</p>\n\n<p><a href="https://sourceforge.net/projects/wagon-sf/" rel="nofollow noreferrer">https://sourceforge.net/projects/wagon-sf/</a></p>\n'}, {'answer_id': 187030, 'author': 'binco', 'author_id': 19671, 'author_profile': 'https://Stackoverflow.com/users/19671', 'pm_score': 0, 'selected': False, 'text': '<p>I found that <a href="http://confluence.public.thoughtworks.org/display/CC/SourceForge+Enterprise+Edition+(SFEE)" rel="nofollow noreferrer">CruiseControl</a> can upload releases to SFEE and also works with Maven and Maven2</p>\n'}, {'answer_id': 1449595, 'author': 'Rich Seller', 'author_id': 123582, 'author_profile': 'https://Stackoverflow.com/users/123582', 'pm_score': 4, 'selected': True, 'text': '<p>I\'m not able to test this to confirm, but I believe it is possible without writing any plugins.</p>\n\n<p>You can <a href="http://sourceforge.net/apps/trac/sourceforge/wiki/SCP" rel="noreferrer">deploy to SourceForge using SCP</a>, and the maven-deploy-plugin can be configured to <a href="http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html" rel="noreferrer">use SCP</a> so it should work. You can also deploy your <a href="http://maven.apache.org/plugins/maven-site-plugin/examples/site-deploy-to-sourceforge.net.html" rel="noreferrer">site to SourceForge</a> via SCP.</p>\n\n<p>You would configure the SourceForge server in your settings.xml to use a "combined" username with a comma separator. With these credentials:</p>\n\n<pre><code>SourceForge username: foo\nSourceForge user password: secret\nSourceForge project name: bar\nPath: /home/frs/project/P/PR/PROJECT_UNIX_NAME/ \n    - Substitute your project UNIX name data for /P/PR/PROJECT_UNIX_NAME \n</code></pre>\n\n<p>The server element would look like this:</p>\n\n<pre><code>&lt;server&gt;\n  &lt;id&gt;sourceforge&lt;/id&gt;\n  &lt;username&gt;foo,bar&lt;/username&gt;\n  &lt;password&gt;secret&lt;/password&gt;\n&lt;/server&gt;\n</code></pre>\n\n<p>And the distributionManagement section in your POM would look like this:</p>\n\n<pre><code>&lt;!-- Enabling the use of FTP --&gt;\n&lt;distributionManagement&gt;\n  &lt;repository&gt;\n    &lt;id&gt;ssh-repository&lt;/id&gt;\n    &lt;url&gt;\nscpexe://frs.sourceforge.net:/home/frs/project/P/PR/PROJECT_UNIX_NAME&lt;/url&gt;\n  &lt;/repository&gt;\n&lt;/distributionManagement&gt;\n</code></pre>\n\n<p>Finally declare that ssh-external is to be used:</p>\n\n<pre><code>&lt;build&gt;\n  &lt;extensions&gt;\n    &lt;extension&gt;\n      &lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt;\n       &lt;artifactId&gt;wagon-ssh-external&lt;/artifactId&gt;\n       &lt;version&gt;1.0-alpha-5&lt;/version&gt;\n    &lt;/extension&gt;\n  &lt;/extensions&gt;\n&lt;/build&gt;\n</code></pre>\n\n<hr>\n\n<p>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:</p>\n\n<pre><code>ssh -t &lt;username&gt;,&lt;project name&gt;@shell.sf.net create\n</code></pre>\n\n<p>Then use shell.sourceforge.net (instead of web.sourceforge.net) in your site URL in the diestributionManagement section:</p>\n\n<pre><code>&lt;url&gt;scp://shell.sourceforge.net/home/frs/project/P/PR/PROJECT_UNIX_NAME/&lt;/url&gt;\n</code></pre>\n'}, {'answer_id': 2187533, 'author': 'Gray', 'author_id': 179850, 'author_profile': 'https://Stackoverflow.com/users/179850', 'pm_score': 1, 'selected': False, 'text': "<p>After trying this a number of times, I finally got it to work -- with <strong>sftp</strong> <em>not</em> 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.</p>\n\n<p>You'll need to change the following in your settings to get it to work:</p>\n\n<ul>\n<li>user -- replace with your sourceforce username</li>\n<li>secret -- replace with your password</li>\n<li>ormlite -- replace with your project name</li>\n<li>/o/or/ -- replace with the first char and first 2 chars of your project name</li>\n</ul>\n\n<p>In my $HOME/.m2/settings.xml file I have the following for the SF server:</p>\n\n<pre><code>&lt;server&gt;\n  &lt;id&gt;sourceforge&lt;/id&gt;\n  &lt;password&gt;secret&lt;/password&gt;\n  &lt;filePermissions&gt;775&lt;/filePermissions&gt;\n  &lt;directoryPermissions&gt;775&lt;/directoryPermissions&gt;\n&lt;/server&gt;\n</code></pre>\n\n<p>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:</p>\n\n<pre><code>&lt;distributionManagement&gt;\n &lt;repository&gt;\n  &lt;id&gt;sourceforge&lt;/id&gt;\n  &lt;name&gt;SourceForge&lt;/name&gt;\n  &lt;url&gt;sftp://user,ormlite@frs.sourceforge.net:/home/frs/project/o/or/ormlite/releases\n  &lt;/url&gt;\n &lt;/repository&gt;\n &lt;snapshotRepository&gt;\n  &lt;id&gt;sourceforge&lt;/id&gt;\n  &lt;name&gt;SourceForge&lt;/name&gt;\n  &lt;url&gt;sftp://user,ormlite@frs.sourceforge.net:/home/frs/project/o/or/ormlite/snapshots\n  &lt;/url&gt;\n &lt;/snapshotRepository&gt;\n&lt;/distributionManagement&gt;\n</code></pre>\n\n<p>Obviously the /releases and /snapshots directory suffixes can be changed depending on your file hierarchy.</p>\n"}, {'answer_id': 2330852, 'author': 'TimP', 'author_id': 60160, 'author_profile': 'https://Stackoverflow.com/users/60160', 'pm_score': 1, 'selected': False, 'text': '<p>Where timp = user and webmacro = project</p>\n\n<p>scp url does not work:</p>\n\n<pre><code>scp://timp,webmacro@shell.sourceforge.net:/home/groups/w/we/webmacro/htdocs/maven2/\n</code></pre>\n\n<p>sftp url works: </p>\n\n<pre><code> sftp://timp,webmacro@web.sourceforge.net:/home/groups/w/we/webmacro/htdocs/maven2\n</code></pre>\n\n<p>or for project release artifacts: </p>\n\n<pre><code>sftp://timp,webmacro@web.sourceforge.net:/home/frs/project/w/we/webmacro/releases\n</code></pre>\n\n<p>scp will work to shell.sourceforge.net, but you have to create the shell before use with </p>\n\n<pre><code>ssh -t timp,webmacro@shell.sourceforge.net create\n</code></pre>\n'}, {'answer_id': 2337482, 'author': 'Huluvu424242', 'author_id': 373498, 'author_profile': 'https://Stackoverflow.com/users/373498', 'pm_score': 2, 'selected': False, 'text': '<p>I have uploaded an example to sourceforge.net at: <a href="http://sf-mvn-plugins.sourceforge.net/example-1jar-thinlet/" rel="nofollow noreferrer">http://sf-mvn-plugins.sourceforge.net/example-1jar-thinlet/</a></p>\n\n<p>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.</p>\n\n<p>The main points to upload are to use sftp:</p>\n\n<p>Add this similar code to your pom.xml</p>\n\n<pre><code>&lt;distributionManagement&gt;\n                &lt;!-- use the following if you\'re not using a snapshot version. --&gt;\n                &lt;repository&gt;\n                    &lt;id&gt;sourceforge-sf-mvn-plugins&lt;/id&gt;\n                    &lt;name&gt;FRS Area&lt;/name&gt;\n                    &lt;uniqueVersion&gt;false&lt;/uniqueVersion&gt;\n                    &lt;url&gt;sftp://web.sourceforge.net/home/frs/project/s/sf/sf-mvn-plugins/m2-repo&lt;/url&gt;\n                &lt;/repository&gt;\n                &lt;site&gt;\n                    &lt;id&gt;sourceforge-sf-mvn-plugins&lt;/id&gt;\n                    &lt;name&gt;Web Area&lt;/name&gt;\n                    &lt;url&gt;\n                        sftp://web.sourceforge.net/home/groups/s/sf/sf-mvn-plugins/htdocs/${artifactId}\n                    &lt;/url&gt;\n                &lt;/site&gt;\n&lt;/distributionManagement&gt;\n</code></pre>\n\n<p>Add similar code to settings.xml</p>\n\n<pre><code>   &lt;server&gt;\n      &lt;id&gt;sourceforge-sf-mvn-plugins-svn&lt;/id&gt;\n      &lt;username&gt;tmichel,sf-mvn-plugins&lt;/username&gt;\n      &lt;password&gt;secret&lt;/password&gt;\n    &lt;/server&gt;\n\n    &lt;server&gt;\n      &lt;id&gt;sourceforge-sf-mvn-plugins&lt;/id&gt;\n      &lt;username&gt;user,project&lt;/username&gt;\n      &lt;password&gt;secret&lt;/password&gt;\n    &lt;/server&gt;\n</code></pre>\n\n<p>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</p>\n\n<p>Please add the following code to your pom.xml</p>\n\n<pre><code>    &lt;repositories&gt;\n        &lt;repository&gt;\n            &lt;id&gt;sourceforge-svn&lt;/id&gt;\n            &lt;name&gt;SF Maven Plugin SVN Repository&lt;/name&gt;\n            &lt;url&gt;http://sf-mvn-plugins.svn.sourceforge.net/svnroot/sf-mvn-plugins/_m2-repo/trunk&lt;/url&gt;\n        &lt;/repository&gt;\n    &lt;/repositories&gt;\n\n\n    &lt;pluginRepositories&gt;\n        &lt;pluginRepository&gt;\n            &lt;id&gt;sourceforge-frs&lt;/id&gt;\n            &lt;name&gt;SF Maven Plugin Repository&lt;/name&gt;\n            &lt;url&gt;http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo&lt;/url&gt;\n        &lt;/pluginRepository&gt;\n    &lt;/pluginRepositories&gt;\n\n    &lt;build&gt;\n    &lt;extensions&gt;\n        &lt;extension&gt;\n            &lt;groupId&gt;net.sf.maven.plugins&lt;/groupId&gt;\n            &lt;artifactId&gt;wagon-http-sourceforge&lt;/artifactId&gt;\n            &lt;version&gt;0.4&lt;/version&gt;\n        &lt;/extension&gt;\n    &lt;/extensions&gt;\n   :\n   &lt;/build&gt;\n</code></pre>\n'}, {'answer_id': 4110138, 'author': 'simbo1905', 'author_id': 329496, 'author_profile': 'https://Stackoverflow.com/users/329496', 'pm_score': 1, 'selected': False, 'text': '<p>This really did not turn out to be that hard. First up I had the mvn site:deploy working following the instructions at <a href="http://maven.apache.org/plugins/maven-site-plugin/examples/site-deploy-to-sourceforge.net.html" rel="nofollow">this sourceforge site</a>. Basically you start the sourceforge shell with </p>\n\n<pre><code>ssh -t user,project@shell.sourceforge.net create\n</code></pre>\n\n<p>That will create the shell at their end with a folder mounted to your project on a path such as (depending on your projects name):</p>\n\n<pre><code>/home/groups/c/ch/chex4j/\n</code></pre>\n\n<p>In that shell I on the sourceforge server I created a folder for my repo under the project apache folder "htdocs" with </p>\n\n<pre><code>mkdir /home/groups/c/ch/chex4j/htdocs/maven2\n</code></pre>\n\n<p>In my settings.xml I set the username and password to that shell server so that maven can login: </p>\n\n<pre><code>&lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"\n  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0\n                      http://maven.apache.org/xsd/settings-1.0.0.xsd/"&gt; \n  &lt;servers&gt;\n        &lt;server&gt;\n            &lt;id&gt;chex4j.sf.net&lt;/id&gt;\n            &lt;username&gt;me,myproject&lt;/username&gt;\n            &lt;password&gt;password&lt;/password&gt;\n            &lt;filePermissions&gt;775&lt;/filePermissions&gt;\n            &lt;directoryPermissions&gt;775&lt;/directoryPermissions&gt;\n        &lt;/server&gt;\n    &lt;/servers&gt;\n&lt;/settings&gt;\n</code></pre>\n\n<p>In the pom.xml you just need your distibutionManagement section setup to name the server by ID that you set the password for in your settings file: </p>\n\n<pre><code>&lt;distributionManagement&gt;\n    &lt;site&gt;\n        &lt;id&gt;chex4j.sf.net&lt;/id&gt;\n        &lt;url&gt;scp://shell.sourceforge.net/home/groups/c/ch/chex4j/htdocs/\n        &lt;/url&gt;\n    &lt;/site&gt;\n    &lt;repository&gt;\n        &lt;id&gt;chex4j.sf.net&lt;/id&gt;\n        &lt;name&gt;SourceForge shell repo&lt;/name&gt;\n        &lt;url&gt;scp://shell.sourceforge.net/home/groups/c/ch/chex4j/htdocs/maven2&lt;/url&gt;\n    &lt;/repository&gt;\n&lt;/distributionManagement&gt;\n</code></pre>\n\n<p>There the repository entry is the one for the mvn deploy command and the site entry is for the mvn site:deploy command. Then all I have to do is start the shell connection to bring up the server side then on my local side just run: </p>\n\n<pre><code>mvn deploy\n</code></pre>\n\n<p>which uploads the jar, pom and sources and the like onto my sourceforge projects website. If you try to hit the /maven2 folder on your project website sourceforge kindly tell you that directory listing is off by default and how to fix it. To do this on the server shell you create a .htaccess file in your htdocs/maven2 folder containing the following apache options </p>\n\n<pre><code>Options +Indexes\n</code></pre>\n\n<p>Then bingo, you have a maven repo which looks like: </p>\n\n<p><a href="http://chex4j.sourceforge.net/maven2/net/sf/chex4j/chex4j-core/1.0.0/" rel="nofollow">http://chex4j.sourceforge.net/maven2/net/sf/chex4j/chex4j-core/1.0.0/</a></p>\n\n<p>Your sf.net shell it shuts down after a number of hours to not hog resources; so you run the "ssh -t ... create" when you want to deploy the site or your build artifacts. </p>\n\n<p>You can browse all my maven project code under sourceforge to see my working settings: </p>\n\n<p><a href="http://chex4j.svn.sourceforge.net/viewvc/chex4j/branches/1.0.x/chex4j-core/" rel="nofollow">http://chex4j.svn.sourceforge.net/viewvc/chex4j/branches/1.0.x/chex4j-core/</a> </p>\n'}, {'answer_id': 4402466, 'author': 'JPT', 'author_id': 536970, 'author_profile': 'https://Stackoverflow.com/users/536970', 'pm_score': 1, 'selected': False, 'text': '<p>SCP URL <em>does</em> work. But do not use ":" after server name. MVN tries to read the following test as integer (port number).</p>\n\n<p>You do not need to establish tunnels as simbo1905 did. </p>\n'}]
['https://Stackoverflow.com/questions/16487', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1969/']