【发布时间】:2014-04-24 09:12:16
【问题描述】:
我有许多 Maven 原型,结构如下
.
├── bundle
├── bundle-for-jcrinstall
├── initial-content
├── launchpad-standalone
├── launchpad-webapp
├── servlet
└── taglib
对于这些,我想有一个共同价值观的单一来源,例如插件版本,这样我就可以在一个地方为所有模块更改它们。更改应该最终在生成的 pom.xml 中,所以我会定义例如bundle/src/main/resources/archetype-resources/pom.xml包含
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>${scrplugin.version}</version>
<executions>
<execution>
<id>generate-scr-descriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
<!-- snip ... -->
然后提供bundle/pom.xml file 中的值,最好是从父 pom 继承。问题是,我不知道如何在 bundle/pom.xml 中提供此值,以便它可用于生成 pom.xml 文件。
任何关于如何做到这一点的想法,或解决此问题的其他方法都非常感谢。
【问题讨论】:
标签: maven maven-3 maven-archetype