-
Notifications
You must be signed in to change notification settings - Fork 268
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
versions:set doesn't set version if non-direct properties are used in version element #916
Comments
This is also an issue with the simplest pom.xml containing:
Running:
should produce:
However it does nothing. The last version of this plugin that worked was 2.13.0 and it remains broken in 2.15.0 |
I see. Thanks for reporting this. I'm looking into this. |
So. Looks like #799 opened a can of worms. Considering reverting it. |
Let me explain what the change that causes the regression did. Then you will probably appreciate the workaround that I will give until the fix is merged in. In #794, a user has noticed that if the I understand that the reason for this 'hack' was so that the plugin interpolated the properties, so that version match happened properly on the interpolated value. Since the plugin used raw (=non-interpolated) files, it would mean that it would have to do the interpolation on its own, lose from Maven. My change made it so that an attempt a (simple) interpolation was done and then the interpolated value was matched. If there was no match, no change was done. It proves that the interpolation was not complete, so it did not work as it should've. I'm going to revert the change now and look for another way to fix the original issue. In the mean time, to go around the restriction with the latest version of the plugin, please use |
- Reviewed the code and the semantics of processAllModules, groupId, artifactId, oldVersion params - Dropped support for partially interpolating the properties to be matched with groupId:artifactId:oldVersion - Matching occurs always unless *processAllModules* is set - If *processAllModules* is not set, *oldVersion* will be respected
Thank you for taking a look at this. |
So @ajarmoniuk I think I am having the same or similar issue but the workaround here doesn't appear to work. So for awareness I have a reactor pom and a multiple child poms setup all using root pom.xml:
The child pom(s) then look like this:
when using the latest -
The
|
Thanks. Gonna check tomorrow (it's 11 pm here in Europe) if my PR covers your case (I think it should). If you're feeling lucky and/or have too much time on your hands, you could also try the PR branch yourself on your setup. |
I will do so later on (in my day). Hopefully be able to confirm for you by the time you are up and working again $whenever tomorrow. Thanks much! |
Grabbed your changes off
Your regression set Thanks for the fix though @ajarmoniuk |
Great to hear. And I'll update the PR with this test case. |
- Reviewed the code and the semantics of processAllModules, groupId, artifactId, oldVersion params - Dropped support for partially interpolating the properties to be matched with groupId:artifactId:oldVersion - Matching occurs always unless *processAllModules* is set - If *processAllModules* is not set, *oldVersion* will be respected - Included an additional test case from mojohaus#916 testing child version
- Reviewed the code and the semantics of processAllModules, groupId, artifactId, oldVersion params - Dropped support for partially interpolating the properties to be matched with groupId:artifactId:oldVersion - Matching occurs always unless *processAllModules* is set - If *processAllModules* is not set, *oldVersion* will be respected - Included an additional test case from mojohaus#916 testing child version
- Reviewed the code and the semantics of processAllModules, groupId, artifactId, oldVersion params - Dropped support for partially interpolating the properties to be matched with groupId:artifactId:oldVersion - Matching occurs always unless *processAllModules* is set - If *processAllModules* is not set, *oldVersion* will be respected - Included an additional test case from #916 testing child version
### What changes were proposed in this pull request? The pr aims to update some maven plugins to newest version. include: - versions-maven-plugin from 2.15.0 to 2.16.0 - maven-source-plugin from 3.2.1 to 3.3.0 - maven-surefire-plugin from 3.1.0 to 3.1.2 - maven-dependency-plugin from 3.5.0 to 3.6.0 ### Why are the changes needed? - versions-maven-plugin 1.Release Notes: https://github.com/mojohaus/versions/releases/tag/2.16.0 2.Bug Fix: Resolves: display-dependency-updates only shows updates from the most major allowed segment (mojohaus/versions#966) ajarmoniuk Resolves mojohaus/versions#931: Fixing problems with encoding in UseDepVersion and PomHelper (mojohaus/versions#932) ajarmoniuk Resolves mojohaus/versions#916: Partially reverted mojohaus/versions#799. (mojohaus/versions#924) ajarmoniuk Resolves mojohaus/versions#954: Excluded plexus-container-default (mojohaus/versions#955) ajarmoniuk Resolves mojohaus/versions#951: DefaultArtifactVersion::getVersion can be null (mojohaus/versions#952) ajarmoniuk BoundArtifactVersion.toString() to work with NumericVersionComparator (mojohaus/versions#930) ajarmoniuk Issue mojohaus/versions#925: Protect against an NPE if a dependency version is defined in dependencyManagement (mojohaus/versions#926) ajarmoniuk - maven-source-plugin v3.2.1 VS v3.3.0: apache/maven-source-plugin@maven-source-plugin-3.2.1...maven-source-plugin-3.3.0 - maven-surefire-plugin Release Notes: https://github.com/apache/maven-surefire/releases/tag/surefire-3.1.2 - maven-dependency-plugin v3.5.0 VS v3.6.0: apache/maven-dependency-plugin@maven-dependency-plugin-3.5.0...maven-dependency-plugin-3.6.0 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. Closes #41641 from panbingkun/SPARK-44085. Authored-by: panbingkun <pbk1982@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
### What changes were proposed in this pull request? The pr aims to update some maven plugins to newest version. include: - versions-maven-plugin from 2.15.0 to 2.16.0 - maven-source-plugin from 3.2.1 to 3.3.0 - maven-surefire-plugin from 3.1.0 to 3.1.2 - maven-dependency-plugin from 3.5.0 to 3.6.0 ### Why are the changes needed? - versions-maven-plugin 1.Release Notes: https://github.com/mojohaus/versions/releases/tag/2.16.0 2.Bug Fix: Resolves: display-dependency-updates only shows updates from the most major allowed segment (mojohaus/versions#966) ajarmoniuk Resolves mojohaus/versions#931: Fixing problems with encoding in UseDepVersion and PomHelper (mojohaus/versions#932) ajarmoniuk Resolves mojohaus/versions#916: Partially reverted mojohaus/versions#799. (mojohaus/versions#924) ajarmoniuk Resolves mojohaus/versions#954: Excluded plexus-container-default (mojohaus/versions#955) ajarmoniuk Resolves mojohaus/versions#951: DefaultArtifactVersion::getVersion can be null (mojohaus/versions#952) ajarmoniuk BoundArtifactVersion.toString() to work with NumericVersionComparator (mojohaus/versions#930) ajarmoniuk Issue mojohaus/versions#925: Protect against an NPE if a dependency version is defined in dependencyManagement (mojohaus/versions#926) ajarmoniuk - maven-source-plugin v3.2.1 VS v3.3.0: apache/maven-source-plugin@maven-source-plugin-3.2.1...maven-source-plugin-3.3.0 - maven-surefire-plugin Release Notes: https://github.com/apache/maven-surefire/releases/tag/surefire-3.1.2 - maven-dependency-plugin v3.5.0 VS v3.6.0: apache/maven-dependency-plugin@maven-dependency-plugin-3.5.0...maven-dependency-plugin-3.6.0 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. Closes apache#41641 from panbingkun/SPARK-44085. Authored-by: panbingkun <pbk1982@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Maven supports 5 property classes in pom.xml files:
env.X
- environment variablesproject.x
- any project properties from the pom.xmlsettings.x
- properties from settings.xmljava.home
x
- properties from<properties>
section of the pom.xmlIf any of the 1-4 property classes is used in
version
element (even transitively) the resolution of the current version will fail, and no new version will be set.E.g. parent pom.xml
child pom.xml
Attempt to set version:
This caught us off guard - we use versions:set to override the version only for our 'dev' builds which are rather seldom run.
Workaround
I know this might be a corner case, and not really an issue, since it is encouraged that the version element is constant and not an expression. Furthermore I couldn't come up with other probable use cases.
Having said that, I think that because some property interpolation is already handled by the plugin, one might expect that all property classes may be used, and be surprised by this behavior.
Please consider whether it's worth handling.
The text was updated successfully, but these errors were encountered: