【发布时间】:2014-06-03 17:42:46
【问题描述】:
我正在尝试创建一个多模块原型,如下所示:
__groupId__.plugin
__groupId__.feature
我想通过 groupId 设置模块的名称。所以我使用__groupId__ 来设置模块名称。问题是这些模板没有被识别。当我使用 __rootArtifactId__ 我的代码有效。我是否使用了错误的模板名称?
我有以下结构:
archetype
|--src
|--main
|--resources
|--sonatype-resources
| |--__groupId__.plugin
| |--__groupId__.feature
| |--pom.xml
|---META-INF
|---maven
|---archetype-metadata.xml
archetype-metadata.xml 中的模块描述如下:
<module id="${groupId}.plugin" dir="__groupId__.parent" name="${groupId}.plugin">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
<directory></directory>
<includes>
<include>.project</include>
<include>build.properties</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="${groupId}.parent" dir="__groupId__.feature" name="${groupId}.feature">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
<directory></directory>
<includes>
<include>.project</include>
<include>build.properties</include>
</includes>
</fileSet>
</fileSets>
</module>
【问题讨论】:
-
<module id="${groupId}.parent" dir="__groupId__.feature"没有意义,在给定的上下文中它要么是${groupId}要么是__groupId__,而不是两者都......
标签: maven maven-archetype