在travis构建期间mvnw权限被拒绝错误

时间:2017-08-30 19:28:34

标签: linux maven continuous-integration travis-ci

我正在尝试使用githubtravis-ci构建应用java-cloud-sample

.travis.yml看起来像这样

language: java
sudo: true
dist: trusty
jdk: oraclejdk9
addons:
  apt:
    packages:
      - oracle-java9-installer
before_script: 
  - chmod a+x ./mvnw

但是当它试图构建应用程序时我得到了这个错误

$ export PATH=$JAVA_HOME/bin:$PATH
$ java -Xmx32m -version
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
$ javac -J-Xmx32m -version
javac 9
3.01s$ ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
/home/travis/.travis/job_stages: line 236: ./mvnw: Permission denied
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 2 of 3.
/home/travis/.travis/job_stages: line 236: ./mvnw: Permission denied
The command "eval ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 3 of 3.
/home/travis/.travis/job_stages: line 236: ./mvnw: Permission denied
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.

我试图设置chmod a+x mvnw,但它也没有帮助。有什么问题?

1 个答案:

答案 0 :(得分:6)

您可以尝试将cross_val_score更改为before_script吗?,如下所示:

before_install