Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add source code to my dependency libraries in Maven?

For instance, I have included into my dependencies junit-addons : junit-addons. But in the maven repository there isn't any source code. And I know it exists (I have downloaded it). How can I modify the dependencies in order to use libraries from my local project instead from the maven repository (I would omit the junit-addons from the respository and use a local JAR and its source code instead).

Note: I use m2eclipse.

like image 914
monzonj Avatar asked Dec 02 '25 01:12

monzonj


1 Answers

I've solved the problem in a very straight forward way:

I have copied into the folder ${user.home}/.m2/repository/{group-name}/{artifactId}/{version}/ the source file following MAVEN standard: {artifactId}-{version}-sources.jar and it works as a charm! Eclipse checks the local repository and finds the sources.

I don't know if this is the MAVEN way, though.

like image 107
monzonj Avatar answered Dec 03 '25 14:12

monzonj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!