3

我们有一个想要在 jenkins 中构建的 REST 服务器。本地一切都很好,但是当我告诉詹金斯构建项目时,它给了我

[INFO] Copying 1 resource
[WARNING] POM for 'com.sun.jersey:jersey-core:pom:1.8:compile' is invalid. Its dependencies (if any) will NOT be available to the current build. 
[INFO] [compiler:compile {execution: default-compile}] 
[INFO] Compiling 2 source files to /usr/share/tomcat6/.jenkins/workspace/xx-engine-integration-server SNAPSHOT/target/classes
[JENKINS] Archiving /usr/share/tomcat6/.jenkins/workspace/xx-engine-integration-server SNAPSHOT/pom.xml to /usr/share/tomcat6/.jenkins/jobs/xx-engine-integration-server SNAPSHOT/modules/our.package.apps$xx-engine-integration-server/builds/2012-07-04_05-23-22/archive/our.package.apps/xx-engine-integration-server/1.0-SNAPSHOT/xx-engine-integration-server-1.0-SNAPSHOT.pom

[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 

[INFO] Compilation failure error: error reading /usr/share/tomcat6/.m2/repository/com/sun/jersey/jersey-core/1.8/jersey-core-1.8.jar; error in opening zip file

有人见过这个吗?为什么 jersey-core pom 无效?为什么 jenkins 需要 tomcat 来构建我的项目?

我的绒球

<!-- ... -->

<packaging>war</packaging>

<!-- Build -->
<build>
    <!-- Filtering -->
    <resources>
        <resource>
            <filtering>true</filtering>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>projects-maven</id>
        <name>My Maven Repository</name>
        <url>http://path.to.our/repository</url>
    </repository>
</repositories>

<dependencies>
            <!-- Include Spring 3.1 dependencies and more.. -->
    <dependency>
        <groupId>our.path</groupId>
        <artifactId>core-modules</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>jersey-spring</artifactId>
        <version>1.8</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

依赖树:

[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) @ xx-manager ---
[INFO] our.package.apps:xx-manager:war:1.0-SNAPSHOT
[INFO] +- our.package.base:xx-connect:jar:1.0-SNAPSHOT:compile
[INFO] |  +- our.package.base:xx-core:jar:1.1-SNAPSHOT:compile
[INFO] |  |  +- org.springframework:spring-aspects:jar:3.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-orm:jar:3.1.0.RELEASE:compile
[INFO] |  |  +- org.aspectj:aspectjrt:jar:1.6.12:compile
[INFO] |  |  +- org.aspectj:aspectjweaver:jar:1.6.12:compile
[INFO] |  |  +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] |  |  +- commons-lang:commons-lang:jar:2.3:compile
[INFO] |  |  +- log4j:log4j:jar:1.2.16:compile
[INFO] |  |  +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] |  |  +- org.slf4j:jcl-over-slf4j:jar:1.6.1:runtime
[INFO] |  |  +- org.slf4j:slf4j-log4j12:jar:1.6.1:runtime
[INFO] |  |  +- junit:junit:jar:4.10:compile
[INFO] |  |  |  \- org.hamcrest:hamcrest-core:jar:1.1:compile
[INFO] |  |  +- org.powermock:powermock-module-junit4:jar:1.4.11:compile
[INFO] |  |  |  \- org.powermock:powermock-module-junit4-common:jar:1.4.11:compile
[INFO] |  |  |     +- org.powermock:powermock-core:jar:1.4.11:compile
[INFO] |  |  |     \- org.powermock:powermock-reflect:jar:1.4.11:compile
[INFO] |  |  |        \- org.objenesis:objenesis:jar:1.2:compile
[INFO] |  |  +- org.powermock:powermock-api-mockito:jar:1.4.11:compile
[INFO] |  |  |  \- org.powermock:powermock-api-support:jar:1.4.11:compile
[INFO] |  |  +- org.mockito:mockito-all:jar:1.8.4:compile
[INFO] |  |  +- com.google.guava:guava:jar:10.0.1:compile
[INFO] |  |  |  \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] |  |  +- com.natpryce:make-it-easy:jar:3.1.0:compile
[INFO] |  |  |  +- org.hamcrest:hamcrest-library:jar:1.2.1:compile
[INFO] |  |  |  \- junit:junit-dep:jar:4.8.1:compile
[INFO] |  |  +- javax.inject:javax.inject:jar:1:compile
[INFO] |  |  +- cglib:cglib:jar:2.2:compile
[INFO] |  |  +- joda-time:joda-time:jar:1.6.2:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.6.0:compile
[INFO] |  |  |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  |  |  +- org.apache.cxf:cxf-api:jar:2.6.0:compile
[INFO] |  |  |  |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.2:runtime
[INFO] |  |  |  |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.1:runtime
[INFO] |  |  |  |  +- org.apache.ws.xmlschema:xmlschema-core:jar:2.0.2:compile
[INFO] |  |  |  |  +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
[INFO] |  |  |  |  \- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] |  |  |  +- org.apache.cxf:cxf-rt-core:jar:2.6.0:compile
[INFO] |  |  |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.6.0:compile
[INFO] |  |  |  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.6.0:compile
[INFO] |  |  |  +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.6.0:compile
[INFO] |  |  |  +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.6.0:compile
[INFO] |  |  |  \- org.apache.cxf:cxf-rt-ws-addr:jar:2.6.0:compile
[INFO] |  |  |     \- org.apache.cxf:cxf-rt-ws-policy:jar:2.6.0:compile
[INFO] |  |  |        \- org.apache.neethi:neethi:jar:3.0.2:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-transports-http:jar:2.6.0:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-transports-local:jar:2.6.0:compile
[INFO] |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.5:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-core-asl:jar:1.9.5:compile
[INFO] |  +- com.sun.jersey:jersey-server:jar:1.12:compile
[INFO] |  |  +- asm:asm:jar:3.1:compile
[INFO] |  |  \- com.sun.jersey:jersey-core:jar:1.12:compile
[INFO] |  +- com.sun.jersey:jersey-client:jar:1.12:compile
[INFO] |  +- com.sun.jersey:jersey-json:jar:1.12:compile
[INFO] |  |  +- org.codehaus.jettison:jettison:jar:1.1:compile
[INFO] |  |  |  \- stax:stax-api:jar:1.0.1:compile
[INFO] |  |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] |  |  |  \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] |  |  |     +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  |  |     \- javax.activation:activation:jar:1.1:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.2:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-xc:jar:1.9.2:compile
[INFO] |  \- com.sun.jersey.contribs:jersey-multipart:jar:1.6:compile
[INFO] |     \- org.jvnet:mimepull:jar:1.4:compile
[INFO] +- our.package.base:xx-security:jar:1.1-SNAPSHOT:compile
[INFO] |  +- our.package.base:xx-data-jpa:jar:1.1-SNAPSHOT:compile
[INFO] |  |  +- org.springframework.data:spring-data-jpa:jar:1.0.3.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons-core:jar:1.1.0.RELEASE:compile
[INFO] |  |  +- org.hibernate:hibernate-core:jar:4.1.3.Final:compile
[INFO] |  |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  |  +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
[INFO] |  |  |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile
[INFO] |  |  |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  |  +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] |  |  |  +- org.javassist:javassist:jar:3.15.0-GA:compile
[INFO] |  |  |  \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
[INFO] |  |  +- org.hibernate:hibernate-entitymanager:jar:4.1.3.Final:compile
[INFO] |  |  +- javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO] |  |  +- org.hibernate:hibernate-validator:jar:4.3.0.Final:compile
[INFO] |  |  +- com.mysema.querydsl:querydsl-apt:jar:2.6.0:compile
[INFO] |  |  |  \- com.mysema.querydsl:querydsl-codegen:jar:2.6.0:compile
[INFO] |  |  |     \- com.mysema.codegen:codegen:jar:0.4.11:compile
[INFO] |  |  +- com.mysema.querydsl:querydsl-jpa:jar:2.6.0:compile
[INFO] |  |  |  \- com.mysema.querydsl:querydsl-core:jar:2.6.0:compile
[INFO] |  |  |     \- com.mysema.commons:mysema-commons-lang:jar:0.2.2:compile
[INFO] |  |  \- mysql:mysql-connector-java:jar:5.1.11:compile
[INFO] |  +- our.package.base:xx-utils:jar:1.1-SNAPSHOT:compile
[INFO] |  |  \- net.sf.opencsv:opencsv:jar:2.3:compile
[INFO] |  +- org.springframework.security:spring-security-core:jar:3.1.0.RELEASE:compile
[INFO] |  +- org.springframework.security:spring-security-config:jar:3.1.0.RELEASE:compile
[INFO] |  +- org.springframework.security:spring-security-web:jar:3.1.0.RELEASE:compile
[INFO] |  +- org.springframework.security:spring-security-acl:jar:3.1.0.RELEASE:compile
[INFO] |  +- org.springframework.security:spring-security-crypto:jar:3.1.0.RELEASE:compile
[INFO] |  \- net.sf.ehcache:ehcache-core:jar:2.4.6:compile
[INFO] +- our.package.base:xx-view-mvc:jar:1.0-SNAPSHOT:compile
[INFO] |  +- org.springframework:spring-webmvc:jar:3.1.0.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-context-support:jar:3.1.0.RELEASE:compile
[INFO] |  +- org.springframework:spring-test:jar:3.1.0.RELEASE:compile
[INFO] |  +- cglib:cglib-nodep:jar:2.2:compile
[INFO] |  +- javax.servlet:jstl:jar:1.2:compile
[INFO] |  \- org.freemarker:freemarker:jar:2.3.19:compile
[INFO] +- our.package.company:xx-engine-integration-server:war:1.0-SNAPSHOT:test
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
[INFO] +- org.springframework:spring-test-mvc:jar:1.0.0.BUILD-SNAPSHOT:test
[INFO] +- xmlunit:xmlunit:jar:1.3:test
[INFO] +- org.springframework:spring-aop:jar:3.1.0.RELEASE:compile
[INFO] |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-asm:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:3.1.0.RELEASE:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.springframework:spring-tx:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:3.1.0.RELEASE:compile
[INFO] \- org.springframework:spring-expression:jar:3.1.0.RELEASE:compile
4

1 回答 1

4

所以这是通常的:依赖冲突..如图mvn dependency:tree -Dincludes=com.sun.jersey所示。叹..

解决方案是升级到 jersey-spring 1.12。

这就是您从教程中复制依赖项而无需担心版本然后将它们与您自己的项目混合的结果。

于 2012-07-04T07:23:01.053 回答