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

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]

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.

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

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

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?

Manual dependency Maven and Jenkins

I have created a Job in Jenkins with some goals in Maven (clean verify compile).
But, when I run the Job has the error:
[ERROR] Failed to execute goal on project NameProject: Could not resolve dependencies for project NameProject:x:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.oracle:ojdbc14:jar:10.2.0.5, org.primefaces.themes:sentinel-theme:jar:2.1.2: Could not find artifact com.oracle:ojdbc14:jar:10.2.0.5 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
I have created manual dependency in Maven
mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
,but Jenkins doesn't know this dependency in the pom.
When I execute verify compile in Maven it's works!, But when I execute in Jenkins doesn't work.
If you want to install it into a local repository, you need to install it into the local repository that is used by the Jenkins Server,i.e. you need to start mvn install on the Jenkins server.
If you have a company Nexus server, it is probably better to install it there.
I have changed the default local repository Maven
<localRepository>C:/Users/nameUser/.m2/repository</localRepository>
My Maven diretory was in a another drive (E:/), when repository in (C:).

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

Resources