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

后端 未结 9 1307
耶瑟儿~
耶瑟儿~ 2020-12-31 11:28

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

相关标签:
9条回答
  • 2020-12-31 11:40

    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>
    
    0 讨论(0)
  • 2020-12-31 11:41

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

    0 讨论(0)
  • 2020-12-31 11:49

    Where timp = user and webmacro = project

    scp url does not work:

    scp://timp,webmacro@shell.sourceforge.net:/home/groups/w/we/webmacro/htdocs/maven2/
    

    sftp url works:

     sftp://timp,webmacro@web.sourceforge.net:/home/groups/w/we/webmacro/htdocs/maven2
    

    or for project release artifacts:

    sftp://timp,webmacro@web.sourceforge.net:/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,webmacro@shell.sourceforge.net create
    
    0 讨论(0)
提交回复
热议问题