views:

1892

answers:

3

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 http://stackoverflow.com/questions/16487/how-can-i-deploy-artifacts-from-a-maven-build-to-the-sourceforge-file-release-s

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

+2  A: 

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.

krosenvold
Is that really the svn of the project? Or their web space? Hosting repostories in the web space is against their terms of service I believe (ran into the problem when trying to host a mercurial repo there). Either way, I want to put the artifacts on their file release section (project downloads).
Thilo
A: 

Very nice solution, thanks to krosenvold. Additionally you can try to generate chesum with this part of 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>
FunThomas424242
A: 

Sorry about this but I don't see a way to link two questions together. I added some information to a similar (duplicate?) question here. It shows how you can maven deploy to SF without the need for any pom tricks or plugins.

http://stackoverflow.com/questions/16487/how-can-i-deploy-artifacts-from-a-maven-build-to-the-sourceforge-file-release-sys/2187533#2187533

Gray
Yes, this page is also linked to in the question itself (as "kind of the opposite").
Thilo
Ooops. Sorry Thilo. Should I delete this post?
Gray