Maven根文件pom.xml插入文件内容



是否有可能从另一个文件注入参数到项目的根pom.xml ?

可能会有"include"参数?

为了在另一个POM中包含一个POM,首先需要创建要包含的POM。

为了做到这一点,创建一个新的maven项目,不包含src/mainsrv/test,并将<packaging>jar</packaging>更改为<packaging>pom</packaging>

在pom.xml中编写你想要包含的所有内容,并将其发布到maven存储库。

之后,您可以将其包含为父项目或pom依赖项:

<parent>
<groupId>include.pom.group-id</groupId>
<artifactId>include-pom-artifacr-id</artifactId>
<version>YOUR_VERSION</version>
</parent>

<dependency>
<groupId>include.pomgroup-id</groupId>
<artifactId>include-pom-artifacr-id</artifactId>
<version>YOUR_VERSION</version>
<type>pom</type>
<scope>import</scope>
</dependency>

最新更新