Monday, 14 March 2022

maven: download sources of all dependencies

‘mvn dependency:sources’ command is used to download sources for all dependencies. You need to execute this command from the location where pom.xml is located.

 

Example

$ mvn dependency:sources
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------< com.sample.app:maven-add-dependency-demo >--------------
[INFO] Building maven-add-dependency-demo 1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:sources (default-cli) @ maven-add-dependency-demo ---
[WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to xml-apis:xml-apis:jar:1.0.b2
Downloading from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.9.0/gson-2.9.0-sources.jar
Downloaded from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.9.0/gson-2.9.0-sources.jar (157 kB at 43 kB/s)
[INFO] 
[INFO] The following files have been resolved:
[INFO]    com.google.code.gson:gson:jar:sources:2.9.0:compile
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.026 s
[INFO] Finished at: 2022-03-15T11:05:27+05:30
[INFO] ------------------------------------------------------------------------
bash-3.2$


 

Reference

https://maven.apache.org/plugins/maven-dependency-plugin/sources-mojo.html

 

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment