You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to include a subproject dependency (Core) in the shadow JAR of another subproject (App). The Core project just contains some classes used in the App project and a plain text file named TEST with some example text in it. The resulting Core JAR includes the original compiled classes and the TEST file correctly.
Now if I include the Core dependency in the App project without any relocation it copies the classes and resources correctly to the resulting shadow JAR, but if I relocate the core package to a package within the app package then the resources of the Core project are not included in the resulting JAR file (the TEST file is missing).
I don't know exactly how to explain the complete project structure so it's probably better if you take a look at the test project yourself: https://github.com/Minecrell/GradleTest
So basicly when I use relocation then the resources of the project dependency are not copied to the resulting JAR.
The text was updated successfully, but these errors were encountered:
using your example project, when I remove the relocation commands, I still do not get the TEST resource into the shadow Jar. Not sure what filtering is happening there.
Which lines have you removed? When I remove this shadowJar configuration block, then the TEST resource is included for me in the App shadowJar (App/build/libs/App-1.0-all.jar) on both Windows and my Linux server, but with the relocation the file does not appear.
Have you found out what is causing this issue? I think the cause is this method. If relocation is configured and no transformators exist for an entry you don't copy it directly and give it to the remapClass method instead. That will relocate the file if it is a class file, but there are also given normal resource files to this method that you just ignore them at the moment instead of copying them to the shadow JAR.
So I think adding a simple else statement there that will just copy the entries instead should fix the problem. What do you think?
Thank you so much for all your effort and time to solve such specific problems! Will test it as soon you release the new version!
Edit: Just saw that you also publish snapshot versions now. I will test them later! :)
I want to include a subproject dependency (
Core
) in the shadow JAR of another subproject (App
). TheCore
project just contains some classes used in theApp
project and a plain text file namedTEST
with some example text in it. The resultingCore
JAR includes the original compiled classes and theTEST
file correctly.Now if I include the
Core
dependency in theApp
project without any relocation it copies the classes and resources correctly to the resulting shadow JAR, but if I relocate the core package to a package within the app package then the resources of theCore
project are not included in the resulting JAR file (theTEST
file is missing).I don't know exactly how to explain the complete project structure so it's probably better if you take a look at the test project yourself: https://github.com/Minecrell/GradleTest
So basicly when I use relocation then the resources of the project dependency are not copied to the resulting JAR.
The text was updated successfully, but these errors were encountered: