I have a multi-module maven project. I have a main \"base-code\" module which creates a jar of all the compiled source code in my project.
I have another module,
What you are looking for is probably uber-jar: a single jar file with all embedded jar dependencies, the newly version of maven-assembly-plugin support this as one of the 4 pre-defined descriptor, check out here.
Try using maven-assembly-plugin replace your maven-jar-plugin like this:
org.apache.maven.plugins
maven-assembly-plugin
com.myproject.Main
true
lib/
jar-with-dependencies
package
single
Alternatively, you can also use maven-shade-plugin to do this.
Hope that helps.