Skip to content
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:2.17.0:set updates grandchilds with wrong version #1103

Closed
schwarfl opened this issue Jul 1, 2024 · 5 comments · Fixed by #1115
Closed

versions:2.17.0:set updates grandchilds with wrong version #1103

schwarfl opened this issue Jul 1, 2024 · 5 comments · Fixed by #1115
Labels
Milestone

Comments

@schwarfl
Copy link

schwarfl commented Jul 1, 2024

Hi,

I think there is a bug in versions:2.17.0:set when used in a maven reactor with different versions. We have

Grandparent: 
  <artifactId>Grandparent</artifactId>
  <version>1</version>
 
Parent:
   <parent>
     <artifactId>Grandparent</artifactId>
     <version>1</version>
  </parent>
  <artifactId>Parent</artifactId>
  <version>100-SNAPSHOT</version>
 
Child:
   <parent>
     <artifactId>Parent</artifactId>
     <version>100-SNAPSHOT</version>
  </parent>
  <artifactId>Child</artifactId>

Grandchild:
   <parent>
     <artifactId>Child</artifactId>
     <version>100-SNAPSHOT</version>
  </parent>
  <artifactId>Grandchild</artifactId>

If one calls
mvn versions:2.17.0:set -DnewVersion=2
Not only the version in grandparent and parent gets updated from 1 to 2 but also the version in Grandchild gets updated from 100-SNAPSHOT to 2. Also the log messages contains
[INFO] Processing change of com.company.test:grandparent:1 -> 2
[INFO] Processing com.company.test:grandparent
[INFO] Updating project com.company.test:grandparent
[INFO] from version 1 to 2
[INFO]
[INFO] Processing com.company.test:parent
[INFO] Updating parent com.company.test:grandparent
[INFO] from version 1 to 2
[INFO]
[INFO] Processing com.company.test:grandchild
[INFO] Updating parent com.company.test:child
[INFO] from version 100-SNAPSHOT to 2

If one calls
mvn versions:2.16.2:set -DnewVersion=2
instead, only grandparent and parent gets updated from 1 to 2.

Attached you find a minimal set to reproduce the error
testVersionsSet.zip

@svetlana-nikitina
Copy link

svetlana-nikitina commented Jul 1, 2024

we experience a similar issue with -pl flag after the new release:

 mvn versions:set -DnewVersion=1.0.0 -pl module-name

updates versions across the whole project and not only one single module

@mricken
Copy link

mricken commented Jul 2, 2024

We also noticed the behavior that @svetlana-nikitina mentioned. Updating in a single module updates across the entire project. Version 2.16.2 didn't do that.

@slawekjaranowski slawekjaranowski added this to the next-release milestone Jul 2, 2024
@slawekjaranowski
Copy link
Member

Thanks for reporting .... I would like to start to check again change: #1051

We can start by add attached example as IT

I can try to work on it but in next week ... and end of July I will have 🌴
So any help can be valuable

@slawekjaranowski
Copy link
Member

we experience a similar issue with -pl flag after the new release:

 mvn versions:set -DnewVersion=1.0.0 -pl module-name

updates versions across the whole project and not only one single module

next example which can be ease added as IT.

@slawekjaranowski
Copy link
Member

slawekjaranowski commented Jul 3, 2024

Does any one want to help .... I will create an issue #1106 and first part of fix in #1107
There is many other ITs for cleanups - can be do one by one.

It will be easier to understand where is a bug.

slawekjaranowski added a commit that referenced this issue Jul 13, 2024
@slawekjaranowski slawekjaranowski linked a pull request Jul 13, 2024 that will close this issue
slawekjaranowski added a commit that referenced this issue Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants