Travis构建全部失败,“bad interpreter: No such file or directory”

huangapple go评论81阅读模式
英文:

Travis failing all builds "bad interpreter: No such file or directory"

问题

由于某些原因,我在使用Maven的Spring Boot项目中,Travis上的所有构建都失败了。我不知道为什么会这样,因为我之前在Django项目中使用Travis是没有问题的。

这是我的travis.yml文件,非常简单:

dist: trusty
language: java
jdk: oraclejdk8
services:
  - mysql
before_install:
  - mysql -e 'CREATE DATABASE petclinic;'
script: mvn test -Dspring.profiles.active=mysql-travis

这是我每次获取的Travis跟踪信息:

$ java -Xmx32m -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
$ javac -J-Xmx32m -version
javac 1.8.0_151
before_install
0.01s$ mysql -e 'CREATE DATABASE petclinic;'
3.01s$ ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
/home/travis/.travis/functions: ./mvnw: /bin/sh^M: bad interpreter: No such file or directory
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 2 of 3.
/home/travis/.travis/functions: ./mvnw: /bin/sh^M: bad interpreter: No such file or directory
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 3 of 3.
/home/travis/.travis/functions: ./mvnw: /bin/sh^M: bad interpreter: No such file or directory
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed 3 times.
The command "./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V" failed and exited with 126 during .
Your build has been stopped.

我在我的Django项目中从未遇到过这个错误,所以我不确定出现了什么问题。在网络上搜索这个错误并没有给我与Travis相关的解决方案。

英文:

for some reasons all the builds in travis are failing in my spring boot project with maven, I don't have a clue why it's happening since I have used it for django projects and it worked fine.

This is my travis.yml, quite simple

dist: trusty
language: java
jdk: oraclejdk8
services:
  - mysql
before_install:
  - mysql -e 'CREATE DATABASE petclinic;'
script: mvn test -Dspring.profiles.active=mysql-travis

and this is the travis trace I get every time

$ java -Xmx32m -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
$ javac -J-Xmx32m -version
javac 1.8.0_151
before_install
0.01s$ mysql -e 'CREATE DATABASE petclinic;'
3.01s$ ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
/home/travis/.travis/functions: ./mvnw: /bin/sh^M: bad interpreter: No such file or directory
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 2 of 3.
/home/travis/.travis/functions: ./mvnw: /bin/sh^M: bad interpreter: No such file or directory
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 3 of 3.
/home/travis/.travis/functions: ./mvnw: /bin/sh^M: bad interpreter: No such file or directory
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed 3 times.
The command "./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V" failed and exited with 126 during .
Your build has been stopped.

I never had this error in my django projects so I'm not sure what's happening, and searching for this error in the web didn't give me a solution related to travis

答案1

得分: 0

非常愚蠢的错误。
由于一些奇怪的原因,根目录中的 mvnw 文件被修改了。第一行应该是注释:

"# !/bin/sh"

但因为某些原因变成了

#!/bin/sh

而 Travis 认为它不是一个注释。

英文:

Really stupid error.
For some strange reason the mvnw file in the root was modified. The first line was supposed to be the comment:

"# !/bin/sh"

but for some reason it became

#!/bin/sh

and travis though it wasn't a comment.

huangapple
  • 本文由 发表于 2020年5月5日 05:13:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/61601720.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定