Failed to execute goal maven release:prepare

Maven

Maven Problem Overview


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]

Maven Solutions


Solution 1 - Maven

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>

Solution 2 - Maven

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.

Solution 3 - Maven

I had the same problem too at using Maven 3.3.1 in Windows 8.1. I searched on it and found that mvn.bat moved to mvn.cmd. Still, I don't know how to solve it at the version. So, I downloaded Maven 3.2.5 and there was the mvn.bat file. And it worked for me.

Solution 4 - Maven

Fixed, i had same problem with maven 3.5.0 instalation, so just copy mvn.cmd and rename it to mvn.bat at C:\Program Files\apache-maven-3.5.0\bin.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser3137501View Question on Stackoverflow
Solution 1 - MavenLucasView Answer on Stackoverflow
Solution 2 - Mavenuser1900266View Answer on Stackoverflow
Solution 3 - MavenhaindView Answer on Stackoverflow
Solution 4 - MavenRahul kView Answer on Stackoverflow