Can't run maven wrapper 2.2.1: Could not locate the Maven launcher JAR in Maven distribution

536 Views Asked by At

CentOS 7, Java 8

I was to build my java project with specific Maven version = 2.2.1 So to do this I use maven wrapper. Doc here

In terminal I run the next command in my Java project's folder:

mvn -N io.takari:maven:0.7.7:wrapper -Dmaven=2.2.1

After executing the goal, we'll have more files and directories in the project:

1. mvnw: it's an executable Unix shell script used in place of a fully installed Maven
2. mvnw.cmd: it's the Batch version of the above script
3. .mvn: the hidden folder that holds the Maven Wrapper Java library and its properties file
4. In my home folder I has the next folder:
/home/my_user/.m2/wrapper/dists/apache-maven-2.2.1-bin/4t5e722kpe8tvsedcs0947snl3/apache-maven-2.2.1

After that, I run our goals like this for the Unix system:

./mvnw clean install

But I get error:

Exception in thread "main" java.lang.RuntimeException: Could not locate the Maven launcher JAR in Maven distribution '/home/my_user/.m2/wrapper/dists/apache-maven-2.2.1-bin/4t5e722kpe8tvsedcs0947snl3/apache-maven-2.2.1'.
    at org.apache.maven.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:50)
    at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:28)
    at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:61)
0

There are 0 best solutions below