0

我的 Maven 构建过程中有问题。有一个使用 maven-invoker-plugin 执行不同任务的 pom 文件:

<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 依赖项上执行。例如 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]

有任何想法吗?

问候

4

2 回答 2

1

尝试在运行前添加安装。例如。

<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

HTH,杰米

于 2013-02-05T22:02:01.253 回答
1

在 pom.xml 旁边添加文件 invoker.properties 并将您的目标放入其中,例如:

invoker.goals = clean install
于 2019-08-13T15:27:14.223 回答