How to make jar files include both java sources and class files with maven?
The Maven Source Plugin creates a jar archive of the source files of the current project. The jar file is, by default, created in the project’s target directory.
If you want to make a jar file which includes both java sources and class files you can use Resources element as specified below xml snippet. After this change on the build element, when you package your project, java files will be included in the output jar file.
<project> <...> <build> <...> <resources> <resource> <directory>${basedir}/src/main/resources</directory> </resource> <resource> <directory>${basedir}/src/main/java</directory> </resource> </resources> <...> </build> <...> </project>
Related posts:
rssYou can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
