New Location

My website has moved to http://www.jasonwhaley.com. Please visit there for the latest and only remain here for legacy content.

Thursday, November 20, 2008

Installing Sources In Maven

A friend of mine was asking how to actually install the sources of a maven project to a repository. Downloading the sources of other dependencies is easy enough - all that needs to happen is the addition of the -DdownloadSources=true argument to your mvn goals. But how do you allow other projects who depend on your artifacts to do the same. The answer: Maven's Source Plugin. Essentially, all you need to do is
mvn source:jar install
for your projects source and
mvn source:test-jar install
for your test source of your project and viola! The sources are now in the repository.

No comments: