简体   繁体   中英

Travis CI build failed

I'm trying to integrate Travis CI with my GitHub project. I managed to configure Travis plugin successfully with my repository by following Travis getting Started Guide

But when i pushed my first commit after integrating Travis ,it is giving me this error when it auto builds.

/home/travis/build.sh: line 179: ./gradlew: Permission denied
The command "eval ./gradlew assemble" failed. Retrying, 2 of 3.

Below is a screenshot of the Travis build : 在此输入图像描述

And these are the lines that i have in my .travis.yml file :

language: java
before_script:
 - chmod +x gradlew

In your .travis.yml add these lines:

before_script:
 - chmod +x gradlew

Travis instances are linux and require write permissions for executables that output artifacts.

I tried that "before_script"-version, but it didn't work for me.

After changing before_script to before_install it worked as expected (and no sudo was required)

before_install:
  - chmod +x gradlew

I tried with this configuration:

language: java
jdk:
  - oraclejdk7

sudo: required

before_install:
 - chmod +x gradlew

script:
  - ./gradlew clean build -i --continue

And everything is green now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM