I have a maven 开发者_如何学Pythonproject which uses the shade plugin to create a jar from several projects.
In addition it is possible with this plugin to create a source jar from these several projects.
For legacy reason we need to have one jar which contains classes and sources, so the combination of the two jars created by the shade plugin.
What is the best way (preferable in maven) to merge these two jars ?
I found the One-Jar but this apparently combines all dependencies - but I want to explictly say "merge this jar and that jar".
Thanks for any help
One possibility is to use the maven assembly plugin to create a single jar specifying and if required, maven dependency plugin.
A simpler way is to tell maven that the source folder is also a resource folder.
Like this :
<build>
...
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
</resources>
...
</build>
精彩评论