Maven - add dependency on artifact source

Posted by Jacob Hansson on Stack Overflow See other posts from Stack Overflow or by Jacob Hansson
Published on 2009-06-17T14:00:09Z Indexed on 2011/01/07 19:53 UTC
Read the original article Hit count: 223

Filed under:
|

I have two maven modules, one that ends up as a jar, and one war that depends on that jar.

I want the jar module to package it's source code together with the compiled classes in the jar, so that the second module is able to access it. I have tried using the maven-source-plugin, but I am confused as to how to add a dependency on the output of that. It seems that the dependency by default goes to the compiled jar, and not the source-code jar (ending with "-source.jar") that maven-source-plugin creates.

How do I add the "-source.jar" as a dependency, while still preserving the dependency on the compiled sources?

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about dependencies