build-helper-maven-plugin: Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.2:set

7.4k views Asked by At

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

There are 1 answers

0
Yashu On

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