我有一個在本地機器上正確構建的項目。在我的公司,我們使用服務器機器進行持續集成,但該機器無法連接到互聯網。所以我設置了artifactory並將我的整個存儲庫複製到它。然後連接jenkins與這個artifactory。所以詹金斯應該做沒有任何問題的建設沒有?因爲它與我的本地項目具有相同的設置。Maven根據運行哪臺機器使用不同的依賴關係?
建立消息的幾秒鐘後彈出,他無法找到一個依賴:
[錯誤]未能就項目的CRS-數據執行目標:無法解析 依賴項目COM .ing.crs:crs-data:jar:1.1.3-SNAPSHOT: 無法收集 的依賴關係[com.ing.crs:crs-framework:jar:1.1.3-SNAPSHOT(compile), org.apache .openjpa:openjpa-all:jar:2.3.0(提供), ibm.websphere:j2ee6:jar:8.5.0(提供), ibm.websphere:jpaThinClient:jar:8.5.0(提供), com .google.guava:合谷ava:jar:14.0.1(compile), org.hamcrest:hamcrest-all:jar:1.3(test),junit:junit:jar:4.11(test), mockito-all:mockito-all:jar:1.8 .4(test),oracle.jdbc:ojdbc6:jar:11.2 (test),com.h2database:h2:jar:1.3.167(test), ibm.websphere:embeddedEJBContainer:jar:8.5.0(test) , com.ing.be:bbllib.DeploymentInfo:jar:2.3.2(provided)]:未能通過 讀取commons-dbcp的工件描述符:commons-dbcp:jar:1.4:可能 不能傳遞工件commons-dbcp :公地DBCP:POM:1.4自/至 crs.maven.repo (http://sdbeapp00433.devbe.development:8082/artifactory/repo):訪問 拒絕: http://sdbeapp00433.devbe.development:8082/artifactory/repo/commons-dbcp/commons-dbcp/1.4/commons-dbcp-1.4.pom - > [Help 1]
但是本地編譯甚至不使用commons-dbcp:commons-dbcp:pom:1.4。這怎麼可能?
的POM:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ing.crs</groupId>
<artifactId>crs-parent-pom</artifactId>
<version>1.1.3-SNAPSHOT</version>
<relativePath>../crs-parent-pom/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>crs-data</artifactId>
<version>${project.crs-data.version}</version>
<profiles>
<profile>
<id>default</id>
<properties>
<dbDictionary>disableAlterSeqenceIncrementBy=true</dbDictionary>
</properties>
</profile>
<profile>
<id>stubs</id>
<properties>
<dbDictionary></dbDictionary>
</properties>
</profile>
</profiles>
<dependencies>
<!-- CRS -->
<dependency>
<groupId>com.ing.crs</groupId>
<artifactId>crs-framework</artifactId>
<version>${project.crs-framework.version}</version>
</dependency>
<!-- Other -->
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-all</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ibm.websphere</groupId>
<artifactId>j2ee6</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ibm.websphere</groupId>
<artifactId>jpaThinClient</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- test -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>mockito-all</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>oracle.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.167</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ibm.websphere</groupId>
<artifactId>embeddedEJBContainer</artifactId>
<version>8.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ing.be</groupId>
<artifactId>bbllib.DeploymentInfo</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>crs-data</finalName>
<outputDirectory>target/crs-data</outputDirectory>
<plugins>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<compilerArguments>-Aopenjpa.source=7 -Aopenjpa.metamodel=true</compilerArguments>
<processors>
<processor>org.apache.openjpa.persistence.meta.AnnotationProcessor6</processor>
</processors>
<outputDirectory>target/generated-sources/metamodel</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/metamodel</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>2.3.0</version>
<executions>
<execution>
<id>enhancer_for_test</id>
<configuration>
<includes>**/entities/**/*.class</includes>
<includes>**/data/**/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
<phase>compile</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>copy-test-persistence</id>
<phase>process-test-resources</phase>
<configuration>
<tasks>
<!--backup the "proper" persistence.xml-->
<copy file="${project.build.outputDirectory}/META-INF/persistence.xml" tofile="${project.build.outputDirectory}/META-INF/persistence.xml.proper"/>
<!--replace the "proper" persistence.xml with the "test" version-->
<!-- copy file="${project.build.testOutputDirectory}/META-INF/persistence.xml" tofile="${project.build.outputDirectory}/META-INF/persistence.xml"/-->
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>restore-persistence</id>
<phase>prepare-package</phase>
<configuration>
<tasks>
<!--restore the "proper" persistence.xml-->
<copy file="${project.build.outputDirectory}/META-INF/persistence.xml.proper" tofile="${project.build.outputDirectory}/META-INF/persistence.xml"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathLayoutType>custom</classpathLayoutType>
<customClasspathLayout>${artifact.artifactId}.${artifact.extension}</customClasspathLayout>
</manifest>
<manifestEntries>
<Implementation-Version>${project.version}</Implementation-Version>
<Build-Time>${timestamp}</Build-Time>
</manifestEntries>
</archive>
</configuration>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.1.1</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
openjpa-maven-plugin
</artifactId>
<versionRange>
[1.0,)
</versionRange>
<goals>
<goal>enhance</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.openjpa
</groupId>
<artifactId>
openjpa-maven-plugin
</artifactId>
<versionRange>
[2.2.1,)
</versionRange>
<goals>
<goal>enhance</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
你可以給我們一些其他關於這個的信息嗎?應該建立沒有任何問題沒有?**你在建什麼(除了共享你的pom.xml)? – Skizzo 2014-09-02 12:23:08
這裏是pom – Juru 2014-09-02 13:20:25
commons-dbcp可以被你的一個依賴/插件使用。將〜/ .m2複製到〜/ jenkins/.m2並重試。第二個解決方案是在artifactory中配置代理和外部存儲庫。 – 2014-09-02 13:26:25