Maven Tutorial - Maven Generate Source Jar

Sometime we need to package the source code into a jar file along with the compiled Java byte code. For example, Eclipse IDE may need the source code jar file to show the source code.

It is also useful for developers who use our deployed project to do source code level debugging.

The "maven-source" plugin can pack our source code and deploy along with our project.

Maven Source Plugin

Add "maven-source" plugin in your "pom.xml" file.

<project xmlns="" xmlns:xsi=""


Issue "mvn install" to package and deploy our project to local repository.

c:\mvn_test\xmlFileEditor>mvn install