2
我在做什麼?爲<some_project>丟失,不依賴現有信息的POM
我創建了一個maven
項目,在那裏我捆綁一些外部罐
project/pom.xml
/bin
/safebrowsing2_2.11-0.2.5.jar
/scala-http-client_2.11-1.0.jar
的庫safebrowsing2_2.11-0.2.5.jar
和scala-http-client_2.11-1.0.jar
捆綁在一起,因爲它們不是在Nexus
提供,並且需要對傳統的目的定製罐。
pom.xml
使用以下plugins
將其打包在一個罐子
<plugins>
<plugin>
<groupId>com.googlecode.addjars-maven-plugin</groupId>
<artifactId>addjars-maven-plugin</artifactId>
<version>1.0.5</version>
<executions>
<execution>
<goals>
<goal>add-jars</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${basedir}/bin</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
當此基礎上Jenkins
運行失敗與以下警告
[WARNING] The POM for com.shn:project-safebrowsing2_2.11-0.2.5.jar:jar:1.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.shn:project-scala-http-client_2.11-1.0.jar:jar:1.0-SNAPSHOT is missing, no dependency information available
和錯誤是
[ERROR] Failed to execute goal on project project-installer: Could not resolve dependencies for project com.project-installer:war:0.19.0-SNAPSHOT: The following artifacts could not be resolved: com.shn:project-external-dependencies-safebrowsing2_2.11-0.2.5.jar:jar:1.0-SNAPSHOT, com.shn:project-scala-http-client_2.11-1.0.jar:jar:1.0-SNAPSHOT: Could not find artifact com.shn:project-safebrowsing2_2.11-0.2.5.jar:jar:1.0-SNAPSHOT in company (http://172.62.11.24:8080/nexus/content/groups/public) -> [Help 1]
16:17:03 [ERROR]
16:17:03 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
16:17:03 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
16:17:03 [ERROR]
16:17:03 [ERROR] For more information about the errors and possible solutions, please read the following articles:
16:17:03 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
問題
是的,我知道他們沒有pom.xml
,但我該如何讓構建通過並生成工件?
有些人會覺得警告和錯誤有些有趣之間的相關性,其他人僅僅注意到警告^^爲了執行,你必須正確地安裝2個錯誤的假象目標。 –
將它們安裝到你的連接中,並完成。或者開始使用存儲庫管理器。 – khmarbaise