0
votes

We have a project and in the pom.xml we did not specify the groupId becuase we inherit it from the parent pom.

If we then run mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion}, we get an error:

[ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.2:set (default-cli) on project dbutils: Execution default-cli of goal org.codehaus.mojo:versions-maven-plugin:2.2:set failed. NullPointerException -> [Help 1]

I checked this is a bug from the maven versions plugin and there are workarounds e.g., using 2.1 instead of 2.2.

Do you know, how can I avoid this error using the build-helper plugin?

Thank you, Yashu

1
Have you tried to use a more recent version of versions-maven-plugin for example 2.4 ? Furthermore which version of the build-helper-maven-plugin do you use?khmarbaise
@khmarbaise I want to do that, but I am not using versions-maven-plugin directly. I am just using build-helper plugin and I think then it internally uses versions-maven-plugin.Yashu
Sure you are using versions-maven-plugin directly cause the part versions:set is exactly the call of versions-maven-plugin goal.khmarbaise
@khmarbaise thanks, it solves my issue: mvn -B build-helper:parse-version org.codehaus.mojo:versions-maven-plugin:2.4:setYashu

1 Answers

1
votes

Thanks to @khmarbaise, I can specify the versoin of versions-maven-plugin:

mvn -B build-helper:parse-version org.codehaus.mojo:versions-maven-plugin:2.4:set