1

当我使用 Java 6 通过 Jenkins 启动 Maven 构建时,我看到一个奇怪的错误。我在测试编译阶段遇到错误,这些错误是

[ERROR] /scratch/jenkins/workspace/subco/subco/myproject/src/test/java/org/mainco/subco/ebook/mvc/  CorrelationUpdateControllerTest.java:[77,48] error: package com.sun.tools.internal.ws.processor.model does not exist
[ERROR] /scratch/jenkins/workspace/subco/subco/myproject/src/test/java/org/mainco/subco/ebook/mvc/CorrelationUpdateControllerTest.java:[77,48] error: package com.sun.tools.internal.ws.processor.model does not exist
[INFO] 2 errors  

这些错误与上面提到的第 77 行无关。那条线是

public class CorrelationUpdateControllerTest extends AbstractNTsubcoTests

如果这很重要,我正在使用 jaxb-api, v 2.2.9。Maven依赖是

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.2.9</version>
</dependency>

下面是正在发生的事情的更详细的输出......

[INFO] ------------------------------------------------------------------------
[INFO] Building subco Admin Module 16.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.ourrepo.com/content/groups/public/org/springframework/spring-oxm/3.1.1.RELEASE/spring-oxm-3.1.1.RELEASE.pom

下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/spring-oxm/3.1.1.RELEASE/spring-oxm-3.1.1.RELEASE.pom (4 KB,23.5 KB/秒)下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/spring-webmvc-portlet/3.1.1.RELEASE/spring-webmvc-portlet-3.1.1.RELEASE.pom 已 下载: http://repo.ourrepo.com/content/groups/public/org/springframework/spring-webmvc-portlet/3.1.1.RELEASE/spring-webmvc-portlet-3.1.1.RELEASE.pom (4 KB at 42.6 KB/秒)下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-web/3.1.3.RELEASE/spring-security-web-3.1.3 .RELEASE.pom 下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-web/3.1.3.RELEASE/spring-security-web-3.1.3.RELEASE.pom (4 KB 133.4 KB/秒)下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-core/3.1.3.RELEASE/spring-security-core-3.1。 3.RELEASE.pom 下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-core/3.1.3.RELEASE/spring-security-core-3.1.3 .RELEASE.pom(4 KB,47.5 KB/秒)下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-config/3.1.3.RELEASE/spring -security-config-3.1.3.RELEASE.pom 下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-config/3.1.3.RELEASE/spring-security-config-3.1.3.RELEASE.pom (4 KB 41.5 KB/秒)下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-taglibs/3.1.3.RELEASE/spring-security-taglibs-3.1。 3.RELEASE.pom 下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-taglibs/3.1.3.RELEASE/spring-security-taglibs-3.1.3 .RELEASE.pom(4 KB,16.5 KB/秒)下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-acl/3.1.3.RELEASE/spring -security-acl-3.1.3.RELEASE.pom 下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-acl/3.1.3.RELEASE/spring-security-acl-3.1.3.RELEASE.pom (4 KB 145.5 KB/秒)下载: http ://repo.ourrepo.com/content/groups/public/org/springframework/spring-oxm/3.1.1.RELEASE/spring-oxm-3.1.1.RELEASE.jarhttp ://repo.ourrepo.com/content/groups/public/org/springframework/spring-webmvc-portlet/3.1.1.RELEASE/spring-webmvc-portlet-3.1.1.RELEASE.jar 下载:http: //repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-web/3.1.3.RELEASE/spring-security-web-3.1.3.RELEASE.jar 下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-core/3.1.3.RELEASE/spring-security-core-3.1.3.RELEASE.jar 下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-config/3.1.3.RELEASE/spring-security-config-3.1.3.RELEASE.jar 下载:http: //repo.ourrepo.com/content/groups/public/org/springframework/spring-oxm/3.1.1.RELEASE/spring-oxm-3.1.1.RELEASE.jar(72 KB,1372.9 KB/秒)下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-taglibs/3.1.3.RELEASE/spring-security-taglibs-3.1.3.RELEASE.jar 下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-taglibs/3.1.3.RELEASE/spring-security-taglibs-3.1.3.RELEASE.jar (21 KB 176.6 KB/秒)下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-acl/3.1.3.RELEASE/spring-security-acl-3.1。 3.RELEASE.jar 下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-config/3.1.3.RELEASE/spring-security-config-3.1.3 .RELEASE.jar (199 KB at 1156.6 KB/sec) 下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-web/3.1.3.RELEASE/spring -security-web-3.1.3.RELEASE.jar(248 KB,1369.5 KB/秒)下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-acl/3.1.3.RELEASE/spring-security-acl-3.1.3.RELEASE.jar (78 KB 2678.2 KB/秒)下载:http://repo.ourrepo.com/content/groups/public/org/springframework/security/spring-security-core/3.1.3.RELEASE/spring-security-core-3.1。 3.RELEASE.jar (333 KB at 1721.7 KB/sec) 下载:http ://repo.ourrepo.com/content/groups/public/org/springframework/spring-webmvc-portlet/3.1.1.RELEASE/spring- webmvc-portlet-3.1.1.RELEASE.jar(187 KB at 621.6 KB/sec) mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.4.1(default-clean) [INFO] [INFO] --- maven-clean-plugin:2.4.1 :clean (default-clean) @myproject --- mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.4.1(default-clean) [debug] 执行 contextualize mojoStarted org.apache.maven.plugins:maven -resources-plugin:2.5(default-resources) [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @myproject --- [INFO] 使用 'UTF-8' 编码复制过滤的资源。[INFO] 复制 7 个资源 mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.5(default-resources) mojoStarted org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2(default) [INFO ] [INFO] --- properties-maven-plugin:1.0-alpha-2:

[INFO] 
[INFO] --- sql-maven-plugin:1.5:execute (create-test-db) @ myproject ---

mojoSucceeded org.codehaus.mojo:sql-maven-plugin:1.5(create-test-db) mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.3.2(default-compile) [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @myproject --- [INFO] 将 40 个源文件编译到 /scratch/jenkins/workspace/subco/subco/myproject/target/classes mojoSucceeded org .apache.maven.plugins:maven-compiler-plugin:2.3.2(default-compile) [debug] 执行 contextualize mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.5(default-testResources) [INFO] [INFO] 使用 'UTF-8' 编码复制过滤的资源。

[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ myproject ---
[INFO] Copying 10 resources

mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.5(default-testResources) mojoStarted org.codehaus.mojo:sql-maven-plugin:1.5(create-stored-proc)[INFO] 跳过 sql 执行

[INFO] 
[INFO] --- sql-maven-plugin:1.5:execute (create-stored-proc) @ myproject ---

mojoSucceeded org.codehaus.mojo:sql-maven-plugin:1.5(create-stored-proc) mojoStarted org.apache.maven.plugins:maven-antrun-plugin:1.7(unzip-liquibase-archive) [INFO] [INFO] --- maven-antrun-plugin:1.7:run (unzip-liquibase-archive) @myproject --- [INFO] 执行任务

main:
mojoSucceeded org.apache.maven.plugins:maven-antrun-plugin:1.7(unzip-liquibase-archive)[INFO] Executed tasks

mojoStarted org.apache.maven.plugins:maven-antrun-plugin:1.7(format-liquibase-files)
[INFO] 
[INFO] --- maven-antrun-plugin:1.7:run (format-liquibase-files) @ myproject ---
[INFO] Executing tasks

main:
[INFO] Executed tasks
mojoSucceeded org.apache.maven.plugins:maven-antrun-plugin:1.7(format-liquibase-files)
mojoStarted com.google.code.maven-replacer-plugin:replacer:1.5.1(create-init-db-test-scripts)
[INFO] 
[INFO] --- replacer:1.5.1:replace (create-init-db-test-scripts) @ myproject ---
[INFO] Replacement run on 1 file.
mojoSucceeded com.google.code.maven-replacer-plugin:replacer:1.5.1(create-init-db-test-scripts)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.3.2(default-testCompile)
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ myproject ---
[INFO] Compiling 8 source files to /scratch/jenkins/workspace/subco/subco/myproject/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /scratch/jenkins/workspace/subco/subco/myproject/src/test/java/org/mainco/subco/ebook/mvc/  CorrelationUpdateControllerTest.java:[77,48] error: package com.sun.tools.internal.ws.processor.model does not exist
[ERROR] /scratch/jenkins/workspace/subco/subco/myproject/src/test/java/org/mainco/subco/ebook/mvc/  CorrelationUpdateControllerTest.java:[77,48] error: package com.sun.tools.internal.ws.processor.model does not exist
[INFO] 2 errors 
[INFO] -------------------------------------------------------------
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.3.2(default-testCompile)
projectFailed org.mainco.subco:myproject:16.0.0-SNAPSHOT
An attempt to send an e-mail to empty list of recipients, ignored.
4

1 回答 1

0

com.sun.tools.internal.ws看起来您正在使用 Web 服务和一些 JAX-WS 工具,例如该工具wsgen

JAX-WS 工具是 Java 开发工具包 (JDK) 的一部分 - 它在 JRE 中找不到的`tools.jar 中。不太可能是原因,但您应该检查 Jenkins 是否使用 JRE。

更有可能是您在 Linux 工作站/服务器上执行此操作,并且您没有安装 Oracle 的 JDK。OpenJDK 可能没有 Sun 的“私有”工具/实现。

于 2013-04-12T21:11:01.350 回答