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

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

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

Related

Maven Release plugin error: Version was not mapped

I'm using maven release plugin and I'm getting the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project ****: Version for '****' was not mapped -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project ****: Version for '****' was not mapped
I run the job from Jenkins and source code is in perforce.
What am I missing?
Thanks.
You need to configure your project to use perforce as an SCM - use the maven-scm-plugin and add the dependency to the P4Maven plugin.
See the P4Maven manual.
See also this question.

Failure building Spring Boot 1.5.4.RELEASE from source

I would like to build spring-boot 1.5.4.RELEASE. To do that I use the command
./mvnw clean install -U -Dmaven.test.skip=true -DskipTests=true
but I got the following problem (see below).
[ERROR] Failed to execute goal on project spring-boot-test: Could not resolve dependencies for project org.springframework.boot:spring-boot-test:jar:1.5.4.RELEASE: Could not find artifact org.springframework.boot:spring-boot:jar:tests:1.5.4.RELEASE in spring-ext (http://repo.spring.io/ext-release-local/) -> [Help 1]
How can I solve this issue?

Logging error when executing Maven SonarQube plugin

I've been facing an issue with Maven SonarQube plugin (v2.6) when Maven version is recent (strictly larger than 3.1).
Here is what I run:
mvn clean verify -Psonar
mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar -Psonar
The first invocation makes sure sources are compiled and JaCoCo agent is prepared.
The interesting part comes, when the second command is run:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project merlin-schema: Error setting Log implementation. Cause: java.lang.reflect.InvocationTargetException: org/slf4j/Marker -> [Help 1]
Any fix to be published?
Replacing default Maven logging implementation is currently not supported. Ticket created: http://jira.sonarsource.com/browse/MSONAR-122

Need help on Sonar Jasmine spec failures

I'm getting the following exception when trying to build the sonar dashboard using maven (mvn sonar:sonar)
Failed to execute goal com.github.searls:jasmine-maven-plugin:1.2.0.0:test (default) on project sample-web: There were Jasmine spec failures. -> [Help 1]
Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project operative-global: Can not execute Sonar: Unable to execute maven plugin: Exception during execution of org.codehaus.mojo:cobertura-maven-plugin:2.5.1:cobertura -> [Help 2]
Could someone help me with the suggestions/comments to resolve the problem?
Thanks,
Kathir
This was related to compatability issues. The issue gets resolved after upgrading the jars to the latest version.

Maven release plugin: release:prepare-with-pom vs -DgenerateReleasePoms

What's the difference between:
mvn release:prepare-with-pom
and
mvn release:prepare -DgenerateReleasePoms=true
The documentation doesn't distinguish between them.
Does that help you? :) this is the output when you're running
mvn release:prepare -DgenerateReleasePoms=true
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0
:prepare (default-cli) on project test-dependency: Generating release POMs is no
longer supported in release:prepare. Please run release:prepare-with-pom instea
d. -> [Help 1]

Resources