将本地JAR依赖项添加到Gradle for Travis CI

时间:2015-08-23 00:44:59

标签: java gradle travis-ci

我正在尝试使用Travis CI构建我的项目。但是,当它尝试编译依赖于jar文件中的资源的Java类时,构建失败。有没有办法让这些JAR文件编译并防止这些错误?

Travis CI控制台:

Unzipping /home/travis/.gradle/wrapper/dists/gradle-1.12-all/2apkk7d25miauqf1pdjp1bm0uo/gradle-1.12-all.zip to /home/travis/.gradle/wrapper/dists/gradle-1.12-all/2apkk7d25miauqf1pdjp1bm0uo
Set executable permissions for: /home/travis/.gradle/wrapper/dists/gradle-1.12-all/2apkk7d25miauqf1pdjp1bm0uo/gradle-1.12/bin/gradle
:compileJava/home/travis/build/vontell/EasyAPI/src/resources/Constructors.java:10: error: cannot find symbol
import java.util.Base64;
                ^
  symbol:   class Base64
  location: package java.util
/home/travis/build/vontell/EasyAPI/src/resources/Constructors.java:12: error: package org.apache.http does not exist
import org.apache.http.Header;
                      ^
...... (these errors continue)

的build.gradle:

apply plugin: 'java'

task wrapper(type: Wrapper) {
    gradleVersion = '2.0'
}

sourceSets {
    main.java.srcDirs = ['src']
    main.resources.srcDirs = ['src']
    test.java.srcDirs = ['tests/java']
    test.resources.srcDirs = ['tests/resources']
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

.travis.yml:

language: java
jdk: oraclejdk7

0 个答案:

没有答案