Adam Bien's Weblog

Bundling Sources And Javadoc With Maven Output

To bundle your project with a source JAR, execute the following command:


mvn source:jar

JavaDoc is generated and packaged adequately:


mvn javadoc:javadoc javadoc:jar

After executing the above commands, you will find the JARs in the target directory:

/target/[PROJECT_NAME]-1.0-SNAPSHOT-javadoc.jar
/target/[PROJECT_NAME]-1.0-SNAPSHOT-sources.jar

JavaDoc and source attachment does not have to be performed on each build. Using maven plugins with lifecycle hooks for this purpose will lead to slower builds and infrequent integrations.

After mvn install, the source and javadoc can be easily referenced by other projects.

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


NEW workshop: HTML 5 and JavaScript Essentials, Three days in April 2017: from Java EE 7 Architectures over Microservices to Performance, Troubleshooting and Monitoring
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacks.news

A book about rethinking Java EE Patterns

Comments:

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