-
Notifications
You must be signed in to change notification settings - Fork 3k
Apply single jar rename in non uberJar case as well #1345
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
Conversation
If the runner jar is still the main artifact, don't rename it, that can break other plugins. |
What gets renamed with this PR is not the |
Please hold off merging this until I can test if this PR actually fixes #1305 ... will try to do so ASAP. Based on what I meanwhile learnt in #1344 (which I didn't fully understand before), it may actually not. It could still be "nice" to do something like this though - but that would be separate from and not really related to #1344 anymore. |
Actually... it's a PITA 😈 to properly test this - because I'd have to get the maven build running inside the S2I builder container to use v999-SNAPSHOT artifacts outside of the container; doable with more effort - but no point: Now that I understand the libs/ business, I don't see how it could work as-is until we do more work in the S2I Builder to also copy libs/ - would you agree @geoand ? So I think this PR is still a good idea so that we are ready for later, but it (alone) does not fix #1305. |
@vorburger agreed! it is not going to work for s2i since the assemble script will not copy the |
Ok, but do we want to suffer from startup penalty because of this? |
I would say that it would be best to get S2I fixed and not use the |
it seems the @gastaldi has a secret he may wants to share with us... |
I fixed that in the Launcher using the Adding the following to the pom.xml <finalName>${project.artifactId}</finalName> Adding the following BuildConfig parameters
|
Thanks @gastaldi! So this PR if merged would mean that only |
@geoand which PR? |
The current one we are talking in :).
to one like this:
thus making |
@geoand did you see my comment on the main artifacts with some maven plugin? |
(and sorry, I'm bit exhausted) |
No worries, I completely understand :) |
Would you then propose that the
(which is what Spring Boot does BTW) |
I need to check which one is declared as the main artifact. I believe it's the "original" jar. |
Let me know what possible failures/pitfalls you have in mind, because I didn't see any to be honest :) |
@geoand could you rebase please? |
@gsmet PR rebased onto latest master |
No we are not good. The main artifact currently is the bare one:
Actually, the runner is not even attached to the project and thus not installed/deployed. We cannot use the So we must still produce the bare artifact and it should be the main artifact. |
@cescoffier I don't understand how your comment is related to this PR? AFAICS, it just renames the main jar to Why does it become a problem now? |
I see the problem the problem that @cescoffier mentions as well. @gsmet In a generated project if the user does |
If we change the jar name, we must update the Mojo to declare this new file as the main artifact. And even with this, it can be weird. If the finalName is set, this finalName must be used despite the naming done in this PR. |
@cescoffier Would it make sense to disable the |
Hmmm, OK. The problem is not new though as we already do this if the |
"install" still make sense. You can depends on classes and resources from your application. |
Understood, makes absolute sense |
@gsmet @cescoffier I guess I should close this PR for time being since I don't thing we have a good solution around the |
OK, closing then. |
Fixes: #1305