Publishing artifacts with sources on archiva

Posted by Palimondo on Stack Overflow See other posts from Stack Overflow or by Palimondo
Published on 2009-07-02T07:26:55Z Indexed on 2010/06/09 22:52 UTC
Read the original article Hit count: 311

Filed under:
|
|
|
|

At work I'm dipping my toes in managing project dependencies with maven. We use Apache Archiva (1.2.1) as a local repository and proxy. I'm adding artifact for open source project, that is not published on any public repository. I've learned that to publish the sources I should use the Classifier field on Upload artifact page. The sources are then listed alongside the jar and pom when I browse the repository.

But when I update my maven dependencies I get only the jar and pom from the repository. I noticed that sources are also missing when the archiva proxies for me the downloads from other public repositories. I didn't find any configuration options in Archiva's admin pages to serve the sources... What am I missing?

Update: I was missing the fact that artifact sources have to be downloaded manually. I.e. the maven client has to request them, which is controlled by command line option -DdownloadSources=true. Maven Integration for Eclipse has a preference setting to always download them as described in Resolving artifact sources. Archiva then serves the sources for local artifacts or proxies the request to remote repositories and caches the sources for future requests.

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about jar