Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up a Maven repository using SourceForge's file servers

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.

like image 461
Thilo Avatar asked Dec 12 '08 06:12

Thilo


People also ask

What are the different types of maven repositories?

A repository in Maven holds build artifacts and dependencies of varying types. There are exactly two types of repositories: local and remote: the local repository is a directory on the computer where Maven runs. It caches remote downloads and contains temporary build artifacts that you have not yet released.

What is m2 repository?

m2 folder is the default folder used by maven to store its: settings. xml file which specifies properties, like the central repository to download your dependencies, the location of the so-called localRepository. by default, the localRepository in which maven stores all the dependencies your project might need to run.


1 Answers

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.

like image 200
krosenvold Avatar answered Sep 28 '22 20:09

krosenvold