I am trying to create two "fatJars" using the ShadowJar plugin as part of the same build file. I am trying to run the shadowJar task twice inside the assembly by declaring two tasks like ShadowJar
So far I have defined two tasks:
task shadowjar_one (type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) task shadowjar_two (type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar)
and now trying to create my banks as follows:
shadowjar_one { mergeServiceFiles() exclude 'somefile.txt' archiveName = 'jar1.jar' appendManifest { attributes 'Main-Class': 'some.package.someClass' } } shadowjar_two { mergeServiceFiles() exclude 'someOtherfile.txt' archiveName = 'jar2.jar' appendManifest { attributes 'Main-Class': 'some.package.someOtherClass' } }
The problem I encountered is that the banks are created, but they do not contain any other dependencies (packages, files, etc.) on the "other" banks. The jars contain only META-INF and the current catalogs of the project packages.
Any idea what could be the problem?
Note: I expect two slightly different jar files to be released. Both should have the same project code base with differences in the Main-Class attribute of the manifest (and a few more minor differences)
Many thanks!
source share