Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to execute goal maven release:prepare

Tags:

maven

I'm having problems when I run mvn release:prepare. I have the following message:

[ERROR] Failed to execute goal org.apache.maven.plugins: maven-release-plugin: 2.5.1: prepare (default-cli) on project marketplace-po c: Failed to invoke Maven build. Error configuring command-line. Reason: Maven executable not found at: C: \ dev \ apache-maven-3.3.1 \ bin \ mvn.bat -> [Help 1] 
like image 774
user3137501 Avatar asked Apr 20 '15 18:04

user3137501


People also ask

What is Maven release prepare?

Preparing a release goes through the following release phases by default: Check that there are no uncommitted changes in the sources. Check that there are no SNAPSHOT dependencies. Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)

What does Maven prepare do?

mvn release:prepare This command prepares for a release in SCM. It goes through several phases to ensure the POM is ready to be released and then creates a tag in SVN which can be used by release:perform to make a release.

How does Mvn release rollback execute when Maven release plugin works?

When a release is rolled back, the following release phases are executed by default: All project POMs are reverted back to their pre-release state locally, and also in the SCM if the previous release command was able to successfully make changes in the SCM to the POMs.

What is executions in Maven?

An <execution> causes the plugin to be executed during the maven build lifecycle, i.e. during your build. The <configuration> allows you to configure the plugin for how it should behave during execution. Many Maven plugins provide documentation about their configuration options, e.g. the maven-compiler-plugin.


2 Answers

As of version 3.3.X, Maven renamed mvn.bat to mvn.cmd. This is fixed in the maven-release-plugin version 2.5.2: MRELEASE-902

They suggest adding the following section in case the fixed plugin version is not picked up automatically:

  <build>     <plugins>         <plugin>           <groupId>org.apache.maven.plugins</groupId>           <artifactId>maven-release-plugin</artifactId>           <version>2.5.1</version>           <dependencies>             <dependency>               <groupId>org.apache.maven.shared</groupId>               <artifactId>maven-invoker</artifactId>               <version>2.2</version>             </dependency>           </dependencies>         </plugin>     </plugins>   </build> 
like image 166
Lucas Avatar answered Oct 10 '22 21:10

Lucas


I just had same problem when running from eclipse, it resolved by making copy of mvn.cmd to mvn.bat

And it worked for me.

like image 42
user1900266 Avatar answered Oct 10 '22 23:10

user1900266