2

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

Yashu
  • 485
  • 1
  • 10
  • 22
  • 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 Sep 13 '17 at 07:03
  • @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 Sep 13 '17 at 09:09
  • 1
    Sure you are using versions-maven-plugin directly cause the part `versions:set` is exactly the call of versions-maven-plugin goal. – khmarbaise Sep 13 '17 at 11:45
  • @khmarbaise thanks, it solves my issue: mvn -B build-helper:parse-version org.codehaus.mojo:versions-maven-plugin:2.4:set – Yashu Sep 13 '17 at 13:02

1 Answers1

3

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

Yashu
  • 485
  • 1
  • 10
  • 22