[1] suggest a way to get source jars of dependencies. But is there a way to get the source repository location of the dependency jars.
1 Answers
You're able by using the dependency plugin (available in 2.9 and up), similar to what is described in the link you've posted, only a different goal
dependency:list-repositories displays all project dependencies and then lists the repositories used.
As an example, running on spring-mvc-showcase
org.apache.maven.plugins:maven-dependency-plugin:2.9:list-repositories
prints the following output
[INFO] Repositories Used by this build: [INFO] id: repository.jboss.com url: http://repository.jboss.com/maven2/ layout: default snapshots: [enabled => true, update => always] releases: [enabled => true, update => daily]
[INFO] id: central url: http://repo1.maven.org/maven2 layout: default snapshots: [enabled => false, update => daily] releases: [enabled => true, update => daily]
[INFO] id: jvnet-nexus-snapshots url: https://maven.java.net/content/repositories/snapshots layout: default snapshots: [enabled => true, update => daily] releases: [enabled => false, update => daily]
[INFO] id: org.springframework.maven.milestone url: http://repo.spring.io/milestone layout: default snapshots: [enabled => false, update => daily] releases: [enabled => true, update => daily]
[INFO] id: org.springframework.maven.snapshot url: http://repo.spring.io/snapshot layout: default snapshots: [enabled => true, update => daily] releases: [enabled => false, update => daily]
[INFO] id: snapshots.jboss.org url: http://snapshots.jboss.org/maven2/ layout: default snapshots: [enabled => true, update => always] releases: [enabled => true, update => daily]

- 27,771
- 4
- 57
- 55
-
By source repository location I meant the SVN or GIT location. – Udara S.S Liyanage Nov 13 '14 at 06:36
-
ok, still not sure if I should delete the answer, thinking of leaving it for whomever. It answers in parts, as the sources jars fetched via dependency:sources, are (if available) downloaded from the repository where the dependency resides, hence the missunderstanding. You in fact need an official project source location for a dependency, and there is no standard for this, but often available in meta data within pom.xml – Master Slave Nov 13 '14 at 06:49