无法找到或加载主类org.apache.maven.wrapper.MavenWrapperMain [英] Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
问题描述
我在这里有一个spring boot项目: https://github.com/jcasbin/jcasbin-springboot-plugin .我在Travis CI中遇到了以下错误:
I have a spring boot project here: https://github.com/jcasbin/jcasbin-springboot-plugin. I encountered the following error in Travis CI:
shell
3.43s$ ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
/home/travis/build/jcasbin/jcasbin-springboot-plugin
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 2 of 3.
似乎 mvnw
命令失败.该文件由我的IDE生成:IntelliJ IDEA 2018.1.我不知道它的用途是什么,为什么会失败?
It seems that the mvnw
command fails. This file is generated by my IDE: IntelliJ IDEA 2018.1. I don't know what it is used for and why does it fail?
我已在此处中触发了一个问题,但是Spring项目说这是Maven包装器的问题,并在这里指出了我的意思.我不太明白这是什么意思.它是Maven错误吗?那该如何解决错误呢?
I already fired an issue in Spring Boot's github issues here, but Spring project said it's Maven wrapper's issue and pointed me here. I don't quite understand what it means. Is it a Maven bug? How to fix the error then?
推荐答案
您在git存储库中缺少 .mvn
文件夹.您应该有一个名为 .mvn
的文件夹,其中包含文件 wrapper/maven-wrapper.jar
, wrapper/maven-wrapper.properties
和<代码> jvm.config .也许您错过了它,因为它是一个隐藏的文件夹.
You're missing the .mvn
folder in your git repository. You should have a folder called .mvn
which contains the files wrapper/maven-wrapper.jar
, wrapper/maven-wrapper.properties
and jvm.config
. Perhaps you missed it because it's a hidden folder.
尝试从命令行执行 git add -f .mvn
,然后提交并推送.
Try doing git add -f .mvn
from the command line then commit and push.
这篇关于无法找到或加载主类org.apache.maven.wrapper.MavenWrapperMain的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!