2016-07-05 62 views
0

下面是使用Jenkins作業構建項目時發生的問題,該項目有一個父pom.xml,它定義了依賴關係的版本,當然還有SNAPSHOTS等。導入的文件不是必需的,或者可能是版本衝突。Jenkins由於不正確的父子pom.xml條目而失敗

我對pom有很深的瞭解,沒有未使用的SNAPSHOT在有效的pom中。

任何人有什麼可能是問題的想法,任何調試技巧將是非常有用的。

在此先感謝。在父POM

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project script: An exception occured while executing the Java class. null: InvocationTargetException: Effective-pom for 'com.xxx.bss.rm.invoicing.messages:compile:pom:0.5.0-SNAPSHOT' contains SNAPSHOT, failing build. Check any properties and make sure they end in .version if they specifify versions. 

屬性

<properties> 
    <coba.cdac-version>7.1.1</coba.cdac-version> 
    <coba.businessentity-version>6.3.6</coba.businessentity-version> 
    <com.xxx.bss.vre.version>2.8.0</com.xxx.bss.vre.version> 
    <java.oam.version>R3F01</java.oam.version> 
    <cil.service.version>3.0.1</cil.service.version> 
    <cil.client.version>5.0.3</cil.client.version> 
    <cil.messaging.version>1.0.0</cil.messaging.version> 
    <bss.ctrl.jmx.monitor.version>3.0.1-E002</bss.ctrl.jmx.monitor.version> 
    <bss.ctrl.version>3.0.2</bss.ctrl.version> 
    <courier.version>4.1.0</courier.version> 
    <com.google.code.gson.gson.version>2.3.1</com.google.code.gson.gson.version> 
    <common.oam.version>1.12.0</common.oam.version> 
    <com.xxx.bss.ecim.cm.observer.version>0.4.0</com.xxx.bss.ecim.cm.observer.version> 
    <com.xxx.bss.osgi.srstub.serviceregistrystub.version>2.0.0 
    </com.xxx.bss.osgi.srstub.serviceregistrystub.version> 
    <org.osgi.service.event.version>1.3.1</org.osgi.service.event.version> 
    <commons-configuration.version>1.9</commons-configuration.version> 
    <com.unboundid-ldapsdk.version>3.0.0</com.unboundid-ldapsdk.version> 
    <org.apache.ant.version>1.9.7</org.apache.ant.version> 
    <ngee.oam.version>2.0.3</ngee.oam.version> 
    <cel-version>3.7.3</cel-version> 
    <avalon-framework-api-version>4.2.0</avalon-framework-api-version> 
    <xalan-version>2.7.1</xalan-version> 
    <xercesImpl-version>2.11.0</xercesImpl-version> 
    <json-version>20140107</json-version> 
    <curator-framework-version>2.10.0</curator-framework-version> 
    <akka.version>2.3.4</akka.version> 
    <scala.version>2.11</scala.version> 
    <common.akka.version>1.0.1</common.akka.version> 
    <cql3-version>2.0.2</cql3-version> 
    <avro-version>1.7.7</avro-version> 
    <!-- <trace.services.version>0.7.0</trace.services.version> --> 
    <javax.servlet.version>2.5.0</javax.servlet.version> 
    <javax.servlet.servlet-api.version>2.5</javax.servlet.servlet-api.version> 
    <mock-http-server.version>3.0</mock-http-server.version> 
    <hector-client.version>3.3.1</hector-client.version> 
    <commons-io.version>2.4</commons-io.version> 
    <junitparams.version>1.0.2</junitparams.version> 
    <activemq.version>5.9.1</activemq.version> 
    <!-- Changed from 2.6 --> 
    <jersey.version>2.10.1</jersey.version> 
    <jersey-media-multipart.version>2.5.1</jersey-media-multipart.version> 
    <jackson.version>1.9.13</jackson.version> 
    <!-- Changed from 4.3 --> 
    <com.eclipsesource.jaxrs.publisher.version>4.1</com.eclipsesource.jaxrs.publisher.version> 
    <com.eclipsesource.jaxrs.jersey.all.version>2.10.1</com.eclipsesource.jaxrs.jersey.all.version> 
    <org.glassfish.jersey.containers.version>2.10.1</org.glassfish.jersey.containers.version> 
    <org.apache.felix.eventadmin.version>1.4.2</org.apache.felix.eventadmin.version> 
    <uncommons.math.version>1.2.2</uncommons.math.version> 
    <apache.fop.version>1.0</apache.fop.version> 
    <javax.inject.version>1</javax.inject.version> 
    <org.ops4j.pax.exam.version>4.7.0</org.ops4j.pax.exam.version> 
    <pax.url.version>2.4.7</pax.url.version> 
    <pax.logging.version>1.8.5</pax.logging.version> 
    <com.xxx.bss.rm.common.datatypes.version>1.20.0</com.xxx.bss.rm.common.datatypes.version> 
    <com.xxx.bss.ms.registry.version>2.1.0</com.xxx.bss.ms.registry.version> 
    <bss.osgi.functioncontrol.version>2.1.0</bss.osgi.functioncontrol.version> 
    <project.msv.fc.version>2.1.0</project.msv.fc.version> 
    <charging.rf.core.version>1.35.0</charging.rf.core.version> 
    <com.xxx.bss.osgi.trace.version>1.0.1</com.xxx.bss.osgi.trace.version> 
    <cpm.cdac.dataenquirey.version>7.1.3</cpm.cdac.dataenquirey.version> 
    <cpm.cdac.common.version>7.0.0</cpm.cdac.common.version> 
    <rmca.cdac.version>23.1.2</rmca.cdac.version> 
    <com.xxx.bss.integrationtest.utils>0.61.0</com.xxxx.bss.integrationtest.utils> 
    <jive.common.version>0.0.1-alpha.62</jive.common.version> 
    <karaf.version>3.0.5</karaf.version> 
    <sigar.version>1.6.4</sigar.version> 
    <sigar-osgi.version>1.0.0</sigar-osgi.version> 
    <org.apache.servicemix.bundles.lucene.version>5.3.1_1</org.apache.servicemix.bundles.lucene.version> 
    <org.apache.servicemix.bundles.jakarta-regexp.version>1.4_1 
    </org.apache.servicemix.bundles.jakarta-regexp.version> 
    <org-apache-xmlgraphics-version>1.7</org-apache-xmlgraphics-version> 
    <org-apache-xmlgraphics-common-version>1.4</org-apache-xmlgraphics-common-version> 
    <xalan-serializer-version>2.7.1</xalan-serializer-version> 
    <xml-apis-version>1.4.01</xml-apis-version> 
    <xml-apis-ext-version>1.3.04</xml-apis-ext-version> 
    <avalon-framework-version>4.3.1</avalon-framework-version> 
    <avalon-logkit-version>2.2.1</avalon-logkit-version> 
    <caf-utility.version>R3B05</caf-utility.version> 
    <org.eclipse.jetty.version>8.1.3.v20120416</org.eclipse.jetty.version> 
    <com.springsource.javax.transaction.version>1.1.0</com.springsource.javax.transaction.version> 
    <com.springsource.javax.jms.version>1.1.0</com.springsource.javax.jms.version> 
    <org.eclipse.jetty.orbit.javax.servlet.version>3.0.0.v201112011016 
    </org.eclipse.jetty.orbit.javax.servlet.version> 
    <commons-lang3.version>3.4</commons-lang3.version> 
    <com.thoughtworks.paranamer.version>2.7</com.thoughtworks.paranamer.version> 
    <org.apache.felix.webconsole.version>4.0.0</org.apache.felix.webconsole.version> 
    <commons-beanutils.version>1.9.2</commons-beanutils.version> 
    <common-logging.version>1.1.1</common-logging.version> 
    <commons-fileupload.version>1.2.2</commons-fileupload.version> 
    <com.squareup.javapoet.version>1.0.0</com.squareup.javapoet.version> 
    <commons-csv.version>1.1</commons-csv.version> 
    <cassandra-driver-core.version>3.0.0-E001</cassandra-driver-core.version> 
    <io.dropwizard.metrics.metrics-core.version>3.1.0</io.dropwizard.metrics.metrics-core.version> 
    <commons-collections.version>3.2.1</commons-collections.version> 
    <org.json-osgi.version>20080701</org.json-osgi.version> 
    <com.eclipsesource.jaxrs.publisher.version>4.1</com.eclipsesource.jaxrs.publisher.version> 
    <org.eclipse.equinox.common.version>3.6.100-v20120522-1841</org.eclipse.equinox.common.version> 
    <org.eclipse.equinox.http.jetty.version>3.0.1-v20121109-203239</org.eclipse.equinox.http.jetty.version> 
    <org.eclipse.equinox.http.servlet.version>1.1.300-v20120522-1841</org.eclipse.equinox.http.servlet.version> 
    <org.eclipse.equinox.metatype.version>1.2.0-v20120522-1841</org.eclipse.equinox.metatype.version> 
    <org.eclipse.osgi.services.version>3.3.100-v20120522-1822</org.eclipse.osgi.services.version> 
    <io.netty.version>4.0.27.Final</io.netty.version> 
    <io.netty.netty.version>3.8.3.Final</io.netty.netty.version> 
    <msg-services.version>1.4.2</msg-services.version> 
    <msg-gateway.version>1.4.2</msg-gateway.version> 
    <uk.nominet.dnsjnio.version>1.0.3-E005</uk.nominet.dnsjnio.version> 
    <com.typesafe.config.version>1.2.1</com.typesafe.config.version> 
    <protobuf-java.version>2.5.0</protobuf-java.version> 
    <scalabuff-runtime.version>1.3.7</scalabuff-runtime.version> 
    <jfree.jfreechart.version>1.0.13</jfree.jfreechart.version> 
    <jfree.jcommon.version>1.0.16</jfree.jcommon.version> 
    <joda-time.version>2.7</joda-time.version> 
    <com.google.guava.version>16.0.1</com.google.guava.version> 
    <javax.ws.rs-api.version>2.0</javax.ws.rs-api.version> 
    <snappy-java.version>1.1.0-M4</snappy-java.version> 
    <ical4j.version>1.0.5.2</ical4j.version> 
    <org.codehaus.groovyall.version>2.2.0</org.codehaus.groovyall.version> 
    <javax.annotation-api.version>1.2</javax.annotation-api.version> 
    <validation-api.version>1.1.0.Final</validation-api.version> 
    <com.springsource.org.apache.commons.codec.version>1.5.0</com.springsource.org.apache.commons.codec.version> 
    <org.eclipse.tycho.org.eclipse.osgi.version>3.9.0.v20130529-1710</org.eclipse.tycho.org.eclipse.osgi.version> 
    <geronimo-jms_1.1_spec.version>1.1.1</geronimo-jms_1.1_spec.version> 
    <org.simpleframework.simple>5.1.6</org.simpleframework.simple> 
    <zookeeper-version>3.4.8</zookeeper-version> 
    <kafka.version>0.9.0.0_1</kafka.version> 
    <org.osgi.version>4.3.1</org.osgi.version> 

    <!-- Invoice CLI --> 
    <core.ui.version>1.3.0</core.ui.version> 
    <charging.core.clamshell>1.5.0</charging.core.clamshell> 

    <com.github.fge.json.validator>2.2.6</com.github.fge.json.validator> 
    <com.github.fge.json.schema.core>1.2.5</com.github.fge.json.schema.core> 
    <com.googlecode.libphonenumber.libphonenumber>7.2.2</com.googlecode.libphonenumber.libphonenumber> 
    <com.google.code.findbugs.jsr305>2.0.1</com.google.code.findbugs.jsr305> 
    <net.sf.jopt-simple.jopt.simple>4.6</net.sf.jopt-simple.jopt.simple> 
    <com.github.fge.uri.template>0.9</com.github.fge.uri.template> 
    <com.github.fge.jackson.coreutils>1.8</com.github.fge.jackson.coreutils> 
    <org.mozilla.rhino>1.7R4</org.mozilla.rhino> 
    <com.github.fge.msg.simple>1.1</com.github.fge.msg.simple> 
    <com.fasterxml.jackson.core.jackson.databind>2.6.4</com.fasterxml.jackson.core.jackson.databind> 
    <com.fasterxml.jackson.core.jackson.annotations>2.6.4</com.fasterxml.jackson.core.jackson.annotations> 
    <com.fasterxml.jackson.core.jackson.core>2.6.4</com.fasterxml.jackson.core.jackson.core> 
    <com.github.fge.msg.simple>1.1</com.github.fge.msg.simple> 
    <com.github.fge.btf>1.2</com.github.fge.btf> 
    <javax.mail.mailapi>1.4.3</javax.mail.mailapi> 
    <camunda.version>7.3.0</camunda.version> 
    <com.h2database.h2.version>1.4.190</com.h2database.h2.version> 
    <org.mybatis.mybatis.version>3.2.8</org.mybatis.mybatis.version> 
    <org.glassfish.jersey.connectors.version>2.10.1</org.glassfish.jersey.connectors.version> 
    <org.apache.httpcomponents.httpclient.version>4.3</org.apache.httpcomponents.httpclient.version> 
    <org.apache.httpcomponents.httpcore.version>4.3</org.apache.httpcomponents.httpcore.version> 
    <com.xxx.bss.commonschemas.version>0.3.0</com.xxx.bss.commonschemas.version> 
    <nl.jqno.equalsverifier.version>1.7.5</nl.jqno.equalsverifier.version> 
    <org.apache.avro.version>1.7.7</org.apache.avro.version> 
    <org.apache.felix.scr.version>1.8.2</org.apache.felix.scr.version> 
    <org.quartz-scheduler.version>2.2.2</org.quartz-scheduler.version> 
    <c3p0.c3p0-version>0.9.1.2</c3p0.c3p0-version> 
    <org.codehaus.fabric3.api.commonj-version>1.1.0</org.codehaus.fabric3.api.commonj-version> 
    <javax.ejb.ejb-api-version>3.0</javax.ejb.ejb-api-version> 
    <org.apache.servicemix.bundles.quartz.version>2.2.2_1</org.apache.servicemix.bundles.quartz.version> 
    <cassandra-version>2.2.6-E001</cassandra-version> 
    <com.xxx.bss.rm.cpm.cdac.translation.version>7.0.0</com.xxx.bss.rm.cpm.cdac.translation.version> 
    <com.googlecode.json-simple.version>1.1.1</com.googlecode.json-simple.version> 
    <metrics.version>1.0.0</metrics.version> 
</properties> 

兒童POM內容

<parent> 
    <groupId>com.xxxx.xxx.xx.xxx.top</groupId> 
    <artifactId>compile</artifactId> 
    <version>0.6.0-SNAPSHOT</version> 
    <relativePath /> 
</parent> 

<groupId>com.xxxx.xxx.xx.xxx.messages</groupId> 
<artifactId>compile</artifactId> 
<version>0.5.0-SNAPSHOT</version> 

<name>${project.groupId}.${project.artifactId}</name> 

我不知道是否有利於在一定程度上..

目標

<goals>clean install -pl script exec:java -Dscript.buildName="invoicing-release" -Dscript.releaseRepository="proj-invoicing-release-local" -Dscript.stagingRepository="proj-invoicing-staging-local" -Dscript.gitWorkArea="${WORKSPACE}/.gitworkarea" -Dscript.repository="${WORKSPACE}/.scriptrepository" -Dscript.mavenSettings="${MAVEN_SETTINGS}" -B -e -Dsurefire.useFile=false --settings ${MAVEN_SETTINGS} -Dorg.ops4j.pax.url.mvn.settings=${MAVEN_SETTINGS} -Dmaven.repo.local=${MAVEN_REPOSITORY} -Dorg.ops4j.pax.url.mvn.localRepository=${MAVEN_REPOSITORY} -Djava.io.tmpdir=${WS_TMP}</goals> 
+0

你可以發佈你的父母和孩子poms引用這個依賴的片段嗎? –

+0

是的,我可以,但這兩個文件內容太大了,我的意思是說你可以理解嗎? –

+0

您可以放入片段而不是完整的pom。 –

回答

0

看起來您正在調用執行mvn release變體的定製Java程序。按照慣例,不允許發佈具有SNAPSHOT依賴關係的項目,即依賴於以'SNAPSHOT'結尾的版本。但是,您的孩子pom.xml引用版本0.5.0-SNAPSHOT的依賴關係。這需要更改爲修復程序版本(一個不以SNAPSHOT結尾),再次按約定,這將是0.5.0。您的依賴的版本0.5.0也可能尚未提供,因此您需要事先執行該項目的發佈。

maven項目版本化的約定如下。在開發過程中,使用xx-SNAPSHOT進行版本控制。對於xx-SNAPSHOT版本化的jar文件,允許生成一個包含新特性的新jar文件,併爲具有相同xx-SNAPSHOT版本的新jar版本(即用新文件替換一個給定的xx-SNAPSHOT jar版本)。然後,一旦開發完成,該項目將發佈和jar將與版本固定版本xx(沒有SNAPSHOT了)。從那時起,版本號爲的罐子修好了版本xx將不會被替換。當然,如果jar版本化的xx不允許改變,那麼他所有的依賴關係也不能改變,即所有的依賴關係必須在固定的版本中。

顯然,程序從jenkins作業開始,檢查是否遵守約定,並在找到版本爲0.5.0-SNAPSHOT的依賴關係之後,它要求先修復此問題。

順便說一句,您的依賴關係的artifactId可能有錯誤 - compile通常是<scope>元素的值。

+0

讓我試試你的解決方案,並接受它的工作原理。 –

相關問題