-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
Repackage goal does not lazily resolve "project.build.finalName" anymore #16456
Comments
It is hard to understand what you’re trying to describe with partial config snippet. Can you share a sample that reproduces what you’re describing? |
Small note, if you're using the |
Demo is at https://github.com/marcust/spring-boot-issue-16456 So when you do a
if you do that with Spring Boot 2.1.3. you get
so basically the behaviour of the standard |
Alright so my attempt at stopping users from specifying a read-only parameter was a bit too agressive. The fact that A revert of 04aadcd will reintroduce the issue so it would be nice if we could detect it and throw an exception instead. There is also some insight in git-commit-id/git-commit-id-maven-plugin#256 |
Hi @snicoll, if I understand your comment #16456 (comment) correctly, the finalName tag in build element works by acciddent. Will it work on purpose in the future (or: may I use it)? Regards, Jürgen |
I meant the former, not the latter. I've edited my comment. You're not supposed to use the one on the plugin as its read-only but there is unfortunately a bug in Maven that doesn't enforce that. Irrespective of that, there is a regression that |
I would have also raised an issue but found this thread about finalName being ignore in 2.1.4.RELEASE. In the meantime we have switched the renaming of the artifact to the maven-assembly-plugin. We were unsure why explicitely defining finalName e.g. for multiple executions was removed in 2.1.0 just using the finalName of the build tag. |
For consistency with other core Maven plugins that used to have this property and made them read-only (with the side effects described above), #12608. |
I had a chat with @rfscholte about this one and the interesting bit is that it's not supposed to work this way in the It "works" in the jar plugin for the same reason that it used to work in our plugin: there is a If the intention in Maven is to invalidate that mechanism in the future, we need to figure out what we should do short term for ours. Removing the field means that resolution does not happen and we're calling the maven model (as we should be according to Maven best practices). |
I've created an issue in the maven-jar-plugin issue tracker to see what the general direction will be. |
This issue also appears to be reported in git-commit-id/git-commit-id-maven-plugin#418. From my understanding this issue which seems to be similar is a problem with spring-boot and some weird maven stuff where final name is assumed immutable, but in fact it happens that some readonly annotation is ignored and thus happens to work in previous versions. Feel free to ping me if you have any questions - for me it seems just another "funny" maven rabbit hole bug :-) |
Thanks. What you’ve described is already described and discussed in this issue and the maven jar plugin issue I’ve created. |
Given the state of affairs, I've decided to revert the fix of #16202 which will bring us in par with what the |
I'm using
git-commit-id-plugin
to build my final name on<build>
level like<finalName>${project.name}-${version.number}</finalName>
and
version.number
is defined as<version.number>${git.commit.time}-${git.commit.id.describe-short}</version.number>
That used to work up to now, but 2.1.4 does not evaluate these variables anymore, so I get
in my target directory, where the one with the unevaluated variables is the actuall repackaged jar.
I tried now half an hour to achieve the same thing any other way and didn't find a solution, I guess that has something to do with #16202. Can we get the old behaviour back?
The text was updated successfully, but these errors were encountered: