In my project I am using a JAR file provided via Maven. But what Maven gives me is only this jar - no javadocs and no sources. Pressing "Download Sources" has no effect: Eclipse still does not find the sources of the jar.
What this depends on? Should repository provide sources automatically?
May be I need to write something in POM to instruct Maven to download sources?
My current pom follows:
<repositories> <repository> <id>xuggle repo</id> <url>http://xuggle.googlecode.com/svn/trunk/repo/share/java/</url> </repository> </repositories> <dependencies> <dependency> <groupId>xuggle</groupId> <artifactId>xuggle-xuggler</artifactId> <version>5.3</version> <type>rar</type> </dependency> </dependencies>
Why Maven does not say any comments on it's sources download fail?
To download sources for dependencies of maven project, right click on project → Maven → Download Sources . Similarly to download JavaDoc for dependencies of maven project, right click on project → Maven → Download JavaDoc .
Download Jar From maven.org.Open a web browser and browse the URL maven.org or search.maven.org. Input the jar library group name or artifact name in the search box, it will list all matched jar libraries. If you know the jar library group name, artifact name, and version, you can input something like g:com.
The “maven-source” plugin is used to pack your source code and deploy along with your project. This is extremely useful, for developers who use your deployed project and also want to attach your source code for debugging.
2020 Update:
The maven dependency plugin should be used whit the dependency:sources
goal:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.1.1</version> <executions> <execution> <id>download-sources</id> <goals> <goal>sources</goal> </goals> <configuration> </configuration> </execution> </executions> </plugin>
This can also be run from the command line as:
mvn dependency:sources -Dsilent=true
Executing mvn dependency:sources
will force maven to download all sources of all jars in the project, if the sources are available (are uploaded in the repository where the artifact is hosted). If you want to download javadoc the command is mvn dependency:resolve -Dclassifier=javadoc
Deprecated:
<properties> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </properties>
mvn dependency:sources mvn dependency:resolve -Dclassifier=javadoc
if it does not have sources it should say something like
[INFO] The following files have NOT been resolved: [INFO] com.oracle:ojdbc6:java-source:sources:12.1.0.1 [INFO] javax:javaee-api:java-source:sources:6.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With