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

Support multiple values for multiple properties in 'set-property' #971

Open
indrakumaryadav opened this issue Jun 8, 2023 · 4 comments
Open

Comments

@indrakumaryadav
Copy link

indrakumaryadav commented Jun 8, 2023

My pom structure looks like - and i am using org.codehaus.mojo:versions-maven-plugin:2.16.0


 <dependency>
      <groupId>com.foo.bar</groupId>
      <artifactId>manchu-core</artifactId>
      <version>[${myartifact.version}]</version>
    </dependency>
    ...
    <dependency>
      <groupId>com.foo.bar</groupId>
      <artifactId>manchu-extra</artifactId>
      <version>[${mysecondArtifact.version}]</version>
    </dependency>

Now i want to set different versions for the property of both versions during Maven build. i tried
mvn versions:set-property -Dpropery=myartifact.version -DnewVersion=10.1.1
but set-propery only set single property and does not set both property values

if I pass it using comma-separated value, it only takes the last property not both

mvn versions:set-property -Dpropery=myartifact.version -DnewVersion=10.1.1, -Dpropery=mysecondartifact.version -DnewVersion=10.5.1

@jarmoniuk
Copy link
Contributor

jarmoniuk commented Jun 8, 2023

You're passing multiple -Dpropery JVM properties. The property you're supposed to be passing is -Dproperty (with a "t"). Please use the -X switch to check the actual properties that you've passed:

mvn -X versions:set-property -Dpropery=myartifact.version -DnewVersion=10.1.1, -Dpropery=mysecondartifact.version -DnewVersion=10.5.1

The plugin will set all the listed properties to the same version, so what you're trying to do here is not supported.

By the way, comma-delimited means using the comma inside the value of the argument, not passing multiple arguments to the shell. So, like this:

-Dparam=value1,value2,value3

@indrakumaryadav
Copy link
Author

Sorry, for the type, that was typing mistake, i am using the correct syntax hence it is working for a single property with a single value,
it is not supported with set-property, so is there any other goal that supports multiple property updates with multiple values?

@jarmoniuk
Copy link
Contributor

jarmoniuk commented Jun 8, 2023

No, there isn't one.

You must execute the goal separately for every properly you want to set.

@slawekjaranowski
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants