我是一个有用的助手,可以帮助您翻译文本。
我正在尝试创建一个综合POM来从零开始构建我们所有的项目。假设我有一个父项目和两个代码项目。它们都在不同的源树中。
父项目:
在“聚合器”项目上运行
有没有办法实现这种反应堆构建?
我正在尝试创建一个综合POM来从零开始构建我们所有的项目。假设我有一个父项目和两个代码项目。它们都在不同的源树中。
父项目:
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
项目 A:
<parent>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath/>
</parent>
<artifactId>project-A</artifactId>
<packaging>jar</packaging>
项目 B:
<parent>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath/>
</parent>
<artifactId>project-B</artifactId>
<packaging>jar</packaging>
现在我正在尝试创建一个单独的聚合POM,将它们全部一起构建,就像这样:
<groupId>com.example</groupId>
<artifactId>aggregator</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>path/to/parent</module>
<module>path/to/project-A</module>
<module>path/to/project-B</module>
</modules>
在“聚合器”项目上运行
mvn clean install
会失败,因为反应堆找不到这两个代码项目的<parent>
。原因很明显-parent
项目是反应堆的一部分,因此在构建开始时该工件不存在。有没有办法实现这种反应堆构建?