假设我有三个 Maven 配置文件。
local-devciprod现在我拥有ci并prod使用相同的插件配置。我根本不想local-dev使用它。所以它看起来像这样。
<profile>
<id>local-dev</id>
</profile>
<profile>
<id>ci</id>
<build>
<plugins>
<plugin>
<artifactId>A-PLUGIN</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<artifactId>A-PLUGIN</artifactId>
</plugin>
</plugins>
</build>
</profile>
Run Code Online (Sandbox Code Playgroud)
事实证明,A-PLUGIN它有很多配置,而且由于它在多个配置文件中完全相同,我很想将它定义在一个地方,然后从所需的配置文件中引用它。