问题描述
我正在为一些开源项目使用SourceForge,我想自动部署到SourceForge文件发布系统的版本。我使用Maven进行构建,除非你做一些手动准备工作,否则标准的SFTP部署机制似乎不起作用。我在其他论坛上发现了一些旧帖子,建议唯一的方法是专门为SourceForge编写一个Wagon。
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?
推荐答案
我无法对此进行测试以确认,但我相信无需编写任何插件即可。
I'm not able to test this to confirm, but I believe it is possible without writing any plugins.
您可以使用SCP ,maven-deploy-plugin可以配置为以便它可以工作。您还可以将通过SCP。
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.
您可以在settings.xml中配置SourceForge服务器,以使用带有逗号分隔符的组合用户名。使用这些凭据:
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
服务器元素如下所示:
<server>
<id>sourceforge</id>
<username>foo,bar</username>
<password>secret</password>
</server>
POM中的distributionManagement部分如下所示:
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>
最后声明要使用ssh-external:
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>
如果这不起作用,你可能会能够在上面的站点参考中使用推荐的方法,即在shell.sourceforge.net上使用您的用户名和项目组创建一个shell:
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
然后在diestributionManagement部分的网站URL中使用shell.sourceforge.net(而不是web.sourceforge.net):
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>
这篇关于如何将Maven构建中的工件部署到SourceForge文件发布系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!