13

Is it possible to host a Maven repository that serves the artifacts (at least the jar files) from SourceForge's file release system (since they are already there and SF provides download statistics and such)?

All the repositories I have seen use the same directory layout, but is that a must? Download URLs would have to look more like http://sf.net/something.cgi?file-id=1234567

There would only be a small number of files in the project, so that maintaining the download URL in some kind of repository metadata XML file semi-manually is still an option.

Note: This is kind of the opposite question to How can I deploy artifacts from a Maven build to the SourceForge File Release System?

Clarification: I want to put the files in the File Release System (Project Downloads), not the project web space or the subversion repository.

4

3 回答 3

3

Yes you can. But it's a bit convoluted:

If you look at a project like this http://jwebunit.sourceforge.net/m2-repo/ you'll see that they are exposing a perfectly legal maven repo. These are the steps to do it:

Theoretically you could just add the relevant part of your ~/.m2/repo folder to the root of svn on the project in question (in a folder called m-2repo for instance like jwebunit has done). Sourceforge exposes the full svn structure accessible through web, so there's your repo.

But; the problem is that maven requires that remote repositories contain MD5 checksums of all elements. When you run "maven install" towards a lolcal file repo you will not get these checksums generated.

The way I have solved this locally is to set up apache/webdav on a specific folder on my machine. I then use THIS folder as a target for "mvn deploy". Then i just keep this full folder checked into subversion on sourceforge.

于 2008-12-12T08:48:49.667 回答
0

对此感到抱歉,但我看不到将两个问题联系在一起的方法。我在此处向类似(重复?)问题添加了一些信息。它展示了如何在不需要任何 pom 技巧或插件的情况下将 maven 部署到 SF。

如何将 Maven 构建中的工件部署到 SourceForge 文件发布系统?

于 2010-02-03T14:16:07.607 回答
0

非常好的解决方案,感谢 krosenvold。此外,您可以尝试使用 pom 的这一部分生成校验和:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>install</goal>
            </goals>
            <configuration>
                <createChecksum>true</createChecksum>
            </configuration>
        </execution>
    </executions>
</plugin>
于 2009-12-13T16:21:27.417 回答