0

Generally speaking, there are three types of package, *.jar , *-sources.jar and *-javadoc.jar, for each artifact in remote maven repository, but mvn only resolves the jar dependencis while compiling the source code.

Could someone tell me how to resolve *-sources.jar and *-javadoc.jar from remote repository by mvn.

爱国者
  • 4,298
  • 9
  • 47
  • 66

3 Answers3

0

I believe the question on how to get the javadoc was answered on a related thread here: Get source JARs from Maven repository

It's mvn dependency:resolve -Dclassifier=javadoc

Community
  • 1
  • 1
Donnacha
  • 61
  • 1
  • 5
0

Strictly speaking, the others are not dependencies, so there is nothing to "resolve".

If you want to retrieve that jar, you can just download [repo-url]/[groupId]/[artifactId]/[version]/[artifactId]-[version]-sources.jar ... most repositories can be navigated through the directory structure, so you should be able to find it simply.

You can also try

mvn dependency:get groupId:artifactId:version:jar:sources -Dtransitive=false
Zac Thompson
  • 12,401
  • 45
  • 57
0

mvn dependency:sources can download the source attachments from remote maven repository if exists. See http://maven.apache.org/plugins/maven-dependency-plugin/usage.html.

But how to get the javadoc?

爱国者
  • 4,298
  • 9
  • 47
  • 66