-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicated modules jar in stageMainDist #159
Comments
Are you able to create a minimal reproducer that demonstrates the issue? |
Hey @JLLeitschuh, I was able to pinpoint the issue to an incompatibility with the ospackage-application plugin: as soon as the plugin is added, the Created this small project to verify that running the Just out of curiosity, why is the renaming necessary for subprojects? Any suggestion on how to work around this? Thanks! |
After some investigation, I'm going to answer my own question:
@JLLeitschuh would it be possible to make the "renaming" functionality configurable by the plugin? |
At this point, I'm more than willing to merge any PR that has sufficient unit & integration tests. @big-guy do you know why this renaming occurs? |
This was something inherited from the old plugin. I think we started doing this because we had a user that had jars coming from subprojects with the same name as external dependencies (or maybe other subprojects). The identically named files would stomp on one another. If we're adding both copies by default, that sounds like a bug. |
It's not a bug of the I tested it locally and making the renaming configurable (default to true to avoid backward compatibility) solves the problem for us. I'll try to write some tests for the new configuration and create a PR when I have some time. Thanks! |
Sorry to take so long to get back to you. I see what's going on now.
What's happening is that both of these plugins apply the Since the issue is more than just the renaming behavior, I think the proper fix is more involved. I think the fix is to change In the mean time, you may be able to workaround this by just applying |
Hey @big-guy thanks for explaining this - I'll see if I have more time to dig into this, but as of now we're working around the mis-configured distribution to remove files based on regexes, and that help us cutting the size of our image in half. Unfortunately we use both plugins ( I'll try to understand you suggestion a bit better - I'm still pretty new to the whole gradle world - and see if we can achieve something by means of configuration only. Thanks for the feedback! |
Not sure this is an issue with my project structure or how the plugin stages jars, but wanted to report it here in order to get a little more visibility.
I haven't been able yet to create a small project to reproduce this, and I'm not a gradle expert, but our I noticed how the jar created for our project has duplicated libraries for all the project's modules.
Our project has the following simplified structure:
build.gradle
settings.gradle
\modules\core\buld.gradle
Now, when I run the
dist
task, defined here, as a step to create our deployable RPM, that is creating a/build/stage/main/lib
with the project library dependencies, and is copying twice the core's module jar and asset's jar, in a way that I have the following files:where 1 and 2 contain the same exact files, same for 3 and 4.
I was able to pinpoint the task
:stageMainDist
as the task copying the dependencies there, but I'm not sure whether this behavior is an issue with the plugin or with our configuration.Has anyone observed the same behavior?
Thanks!
The text was updated successfully, but these errors were encountered: