Attaching Sources and JavaDoc to Maven Project

One of the features of Maven Dependency Plugin is attachment of sources to a project. The attachment can be accomplished from the command line without any pom.xml modification:

The following command downloads and attaches the sources to all dependencies listed in pom.xml:


mvn dependency:sources

With the optional classifier parameter, you can download and attach a javadoc jar to the project.


mvn dependency:sources -Dclassifier=javadoc

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


NEW online workshop: WebStandards Igniter (online)

Airport MUC workshops: Java EE 8, Java 9: Bootstrap, Effective, Architectures, Single Page Apps, Progressive Web Apps, HTML 5, ES 6, CSS 3 and Microservices

Podcast: airhacks.fm and newsletter: airhacks.news

A book about rethinking Java EE Patterns

Comments:

hmmm, this might be a stupid question, but why anyone would benefit from doing it manually ? I mean Ide does is by itself, and without IDE you don't get any benefit from attachment of javadoc.jar, am I wrong ?

Posted by psychollek on December 22, 2014 at 10:08 AM CET #

I don't know how to tell Idea to download the source/javadoc for a particular library, so that command is perfect when being used with -DincludeGroupIds=...

Posted by Thai on December 26, 2014 at 09:25 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
realworldpatterns.com
Online Workshops
...the last 150 posts
...the last 10 comments
License