我在maven构建过程中遇到了一个问题。有一个pom文件,它使用maven-invoker-plugin来执行不同的任务:
<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 release:prepare“时,将不会对子pom依赖项执行install目标。例如,pom1.xml具有以下依赖关系:
<dependency>
<groupId>com.qnamic.dis</groupId>
<artifactId>DisAdminToolWithPlugins</artifactId>
<version>${project.parent.version}</version>
<type>pom</type>
<scope>runtime</scope>
.....但是这个依赖项(在本例中是pom文件)不会安装在我本地的maven repo中,因此不会被找到:
[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]有什么想法吗?
问候
发布于 2013-02-06 06:02:01
尝试在运行前添加install。例如:
<execution>
<id>createWebstartApps</id>
<phase>process-resources</phase>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
...有关更多信息,请访问:http://maven.apache.org/plugins/maven-invoker-plugin/install-mojo.html & http://maven.apache.org/plugins/maven-invoker-plugin/usage.html
啊哈,杰米
发布于 2019-08-13 23:27:14
将文件invoker.properties添加到您的pom.xml旁边,并将您的目标放入其中,如下所示:
invoker.goals = clean installhttps://stackoverflow.com/questions/14707291
复制相似问题