Maven Source Plugin

The Maven Source Plugin is used to create a jar archive of the source files of your project.


  • source:aggregate aggregates sources for all modules in an aggregator project.
  • source:jar is used to bundle the main sources of the project into a jar archive.
  • source:test-jar on the other hand, is used to bundle the test sources of the project into a jar archive.
  • source:jar-no-fork is similar to jar but does not fork the build lifecycle.
  • source:test-jar-no-fork is similar to test-jar but does not fork the build lifecycle.



Run the following maven command to generate jar archive of project source files:

mvn install


[INFO] Installing C:\projects\HelloWorldApplication\target\HelloWorld-1.0-SNAPSHOT-sources.jar to C:\Users\Bijan\.m2\repository\com\qascript\HelloWorld\1.0-SNAPSHOT\HelloWorld-1.0-SNAPSHOT-sources.jar

Bijan Patel

Founder & Creator of QAScript | 12+ years of IT Experience | Full Stack Automation Engineer | Blogger | Trainer

You may also like...

Leave a Reply

Your email address will not be published.