我在我的maven構建過程中遇到問題。有它使用Maven的調用,插件來執行不同任務的POM文件:maven-invoker不會調用依賴的安裝
<execution>
<id>createWebstartApps</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<projectsDirectory>.</projectsDirectory>
<streamLogs>true</streamLogs>
<pomIncludes>
<pomInclude>pom1.xml</pomInclude>
</pomIncludes>
....
但是當我使用maven發佈插件「MVN發佈:準備」的安裝目標將不上孩子POM被執行依賴。例如,pom1.xml具有以下依賴:
<dependency>
<groupId>com.qnamic.dis</groupId>
<artifactId>DisAdminToolWithPlugins</artifactId>
<version>${project.parent.version}</version>
<type>pom</type>
<scope>runtime</scope>
.....
但這種依賴性(在這種情況下,POM文件)將不會被安裝在我的本地Maven回購,因此不會被發現:
[INFO] [INFO] Building: pomWebstartDisAdminTool.xml
[INFO] [INFO] [INFO] Scanning for projects...
[INFO] [INFO] [INFO]
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [INFO] Building RailOpt DIS Admin Tool 4.9.12
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [WARNING] The POM for com.qnamic.dis:DisAdminToolWithPlugins:pom:4.9.12 is missing, no dependency information available
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [INFO] BUILD FAILURE
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [INFO] Total time: 0.203s
[INFO] [INFO] [INFO] Finished at: Tue Feb 05 13:00:04 CET 2013
[INFO] [INFO] [INFO] Final Memory: 4M/15M
[INFO] [INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [ERROR] Failed to execute goal on project DisAdminToolWebstart: Could not resolve dependencies for project com.qnamic.dis:DisAdminToolWebstart:pom:4.9.12: Failure to find com.qnamic.dis:DisAdminToolWithPlugins:pom:4.9.12 in http://maven.ad.bls.ch/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of bls-public has elapsed or updates are forced -> [Help 1]
有什麼想法?
關於
你爲什麼用使用Maven的調用做其他任務** **通常不存在的Maven 。你想達到什麼目的?你應該考慮配置maven-inovker-plugin的extraArtifacts。 – khmarbaise
嗨!我無法回答你的問題,因爲這是現有的(舊)代碼,我只是想讓它重新構建。我也認爲應該有更好的方式來做到這一點..但我不是maven專家: - /我也開放新想法 – puzste