我这里有一个 spring boot 项目: https ://github.com/jcasbin/jcasbin-springboot-plugin。我 在 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。我不知道它是做什么用的,为什么会失败?
我已经在 此处 的 Spring Boot 的 github 问题中提出了一个问题,但 Spring 项目说这是 Maven 包装器的问题并指出我在这里。我不太明白这是什么意思。这是一个 Maven 错误吗?那如何修复错误呢?
原文由 hsluoyz 发布,翻译遵循 CC BY-SA 4.0 许可协议
您缺少 git 存储库中的
.mvn
文件夹。 You should have a folder called.mvn
which contains the fileswrapper/maven-wrapper.jar
,wrapper/maven-wrapper.properties
andjvm.config
.也许您错过了它,因为它是一个隐藏文件夹。尝试从命令行执行
git add -f .mvn
然后提交并推送。