找不到jenkins gradle包

时间:2015-07-28 17:20:46

标签: maven groovy jenkins gradle build.gradle

所以我有一个项目,我正在从maven迁移到gradle,我已经成功地在我的本地机器上运行gradle init和gradle build(mac os yosemite 10.10.3)。但是,当我尝试通过jenkins构建项目时,我收到以下错误:

/data/jenkins-master/tools/hudson.plugins.gradle.GradleInstallation/Gradle_2.5/bin/gradle build
:compileJava
/data/jenkins master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesRestEndpoint.java:3: error: package com.aaron.web.generated does not exist
import com.aaron.web.generated.Response;
                                     ^
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:4: error: package com.aaron.web.generated does not exist
import com.aaron.web.generated.Response;
                                     ^
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:5: error: package com.aaron.web.generated does not exist
import com.aaron.web.generated.ResponseCode;
                                     ^
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesRestEndpoint.java:30: error: cannot find symbol## Heading ##
    public Response prepareFile(@PathParam("code") String code) {
           ^
  symbol:   class Response
  location: class RawFileServicesRestEndpoint
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:35: error: cannot find symbol
    public Response prepareFile(String code, String clientAddr) {
           ^
  symbol:   class Response
  location: class RawFileServicesHelper
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesSoapEndpoint.java:3: error: package com.aaron.web.generated does not exist
import com.aaron.web.generated.RawFileServices;
                                     ^
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesSoapEndpoint.java:4: error: package com.aaron.web.generated does not exist
import com.aaron.web.generated.Response;
                                     ^
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesSoapEndpoint.java:20: error: cannot find symbol
public class RawFileServicesSoapEndpoint implements RawFileServices {
                                                    ^
  symbol: class RawFileServices
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesSoapEndpoint.java:28: error: cannot find symbol
    public Response prepareFile(String code) {
           ^
  symbol:   class Response
  location: class RawFileServicesSoapEndpoint
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:44: error: cannot find symbol
            Response response = new Response();
            ^
  symbol:   class Response
  location: class RawFileServicesHelper
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:44: error: cannot find symbol
            Response response = new Response();
                                    ^
  symbol:   class Response
  location: class RawFileServicesHelper
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:47: error: cannot find symbol
                response.setCode(ResponseCode.CODE_NOT_FOUND);
                                 ^
  symbol:   variable ResponseCode
  location: class RawFileServicesHelper
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:50: error: cannot find symbol
                response.setCode(ResponseCode.SAMPLE_NOT_VALID);
                                 ^
  symbol:   variable ResponseCode
  location: class RawFileServicesHelper
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:75: error: cannot find symbol
                    response.setCode(ResponseCode.COMPLETED);
                                     ^
  symbol:   variable ResponseCode
  location: class RawFileServicesHelper
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:98: error: cannot find symbol
                        response.setCode(ResponseCode.ABORTED);
                                         ^
  symbol:   variable ResponseCode
  location: class RawFileServicesHelper
/data/jenkins-master/jobs/myproject/workspace/src/main/java/com/aaron/web/RawFileServicesHelper.java:101: error: cannot find symbol
                        response.setCode(ResponseCode.IN_PROCESS);
                                         ^
  symbol:   variable ResponseCode
  location: class RawFileServicesHelper
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
16 errors
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

这是我的build.gradle文件:

apply plugin: 'java'
apply plugin: 'maven'

group = 'com.aaron.web'
version = '1.0'

description = """"""

sourceCompatibility = 1.7
targetCompatibility = 1.7

repositories {
     maven { url "http://maven.mystuff.com/nexus/content/groups/aaron/" }
     maven { url "http://archiva.mystuff.com/repository/cms-releases" }
     maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
    compile group: 'com.google.guava', name: 'guava', version:'11.0.2'
    compile group: 'commons-io', name: 'commons-io', version:'2.0.1'
    compile group: 'org.apache.tomcat', name: 'tomcat-jdbc', version:'7.0.21'
    compile group: 'org.springframework', name: 'spring-orm', version:'4.1.6.RELEASE'
    compile group: 'org.springframework', name: 'spring-web', version:'4.1.6.RELEASE'
    compile group: 'org.hibernate', name: 'hibernate-entitymanager', version:'3.4.0.GA'
    compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.12'
    compile group: 'org.springframework', name: 'spring-context', version:'4.1.6.RELEASE'
    compile group: 'mysql', name: 'mysql-connector-java', version:'5.1.10'
    compile group: 'com.sun.xml.ws', name: 'jaxws-rt', version:'2.2.10'
    compile group: 'org.springframework', name: 'spring-aspects', version:'4.1.6.RELEASE'
    compile group: 'org.aspectj', name: 'aspectjrt', version:'1.6.8'
    compile(group: 'org.jvnet.jax-ws-commons.spring', name: 'jaxws-spring', version:'1.9') {
exclude(module: 'servlet-api')
    }
    compile group: 'commons-lang', name: 'commons-lang', version:'2.4'
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.1.1'
    compile group: 'com.aaron', name: 'sla', version:'1.0.4'
    compile group: 'org.eclipse.jetty', name: 'jetty-webapp', version:'9.3.0.M2'
    compile group: 'org.springframework', name: 'spring-webmvc', version:'4.1.6.RELEASE'
    compile group: 'org.slf4j', name: 'slf4j-simple', version:'1.7.12'
    compile(group: 'com.sun.jersey.contribs', name: 'jersey-spring', version:'1.9') {
        exclude(module: 'spring')
        exclude(module: 'spring-core')
        exclude(module: 'spring-web')
        exclude(module: 'spring-beans')
        exclude(module: 'spring-context')
    }
    compile group: 'com.sun.jersey', name: 'jersey-server', version:'1.9'
    compile group: 'com.sun.jersey', name: 'jersey-json', version:'1.9'
    testCompile(group: 'org.mockito', name: 'mockito-core', version:'1.9.5') {
        exclude(module: 'hamcrest-core')
    }
    testCompile group: 'junit', name: 'junit', version:'4.12'
}

jenkins运行的操作系统具有以下规范(当我运行unix cmd“uname -a”时显示):

Linux PRDSLHLSRVJNK05 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux

两个系统都使用相同版本的gradle和groovy(2.5和2.3.10)。关于什么可能导致构建在一台机器上成功而在另一台机器上失败的任何想法?经过一段时间的故障排除后,我完全不知所措。

0 个答案:

没有答案