这个问题是完全相同的副本:
- Maven的原型3.0.3创建:从多个模块项目 1个回答
我有一个原型项目与这个样子的(有两个模块, __artifactId__-1
和__artifactId__-2
):
Parent
pom.xml
__artifactId__-1
pom.xml
__artifactId__-2
pom.xml
并且,当我生成使用这个原型与工件ID说“红外线”的一个项目,它应该产生的结构是这样的:
Parent
pom.xml
Infra-1
pom.xml
Infra-2
pom.xml
其中它。 所以这确实工作。
什么不工作是在父pom.xml中,我已经包括此模块为:
<modules>
<module>__artifactId__-1</module>
<module>__artifactId__-2</module>
</modules>
这些模块条目没有得到重命名为像(上一代):
<modules>
<module>Infra-1</module>
<module>Infra-2</module>
</modules>
这就是我要的。
任何想法如何可以做到这一点,谢谢。
更新我在这里添加元数据的XML文件要求,但我不希望修改原型-metadata.xml文件。 因为我想使用create-从项目命令创建原型,然后安装并无需任何人工干预或返工产生。
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="archetype-1"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
<directory>__artifactId__-1/src</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>support</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
<include>**/*.txt</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>properties/deploy</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>__artifactId__-2/target</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>__artifactId__-2/src</directory>
<includes>
<include>**/*.jsp</include>
<include>**/*.java</include>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>properties</directory>
<includes>
<include>**/*.properties</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>__artifactId__-2</directory>
<includes>
<include>**/*.project</include>
<include>**/*.xml</include>
<include>**/*.classpath</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>__artifactId__-1</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>support/lib</directory>
<includes>
<include>**/*.txt</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>__artifactId__-2/.settings</directory>
<includes>
<include>**/*.prefs</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>support</directory>
<includes>
<include>**/*.jar</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>__artifactId__-2/src</directory>
<includes>
<include>**/*.jpg</include>
<include>**/*.MF</include>
<include>**/*.md</include>
<include>**/*.png</include>
<include>**/*.jar</include>
<include>**/*.js</include>
<include>**/*.ftl</include>
<include>**/*.xsd</include>
<include>**/*.XML</include>
<include>**/*.TXT</include>
<include>**/*.gif</include>
<include>**/*.css</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>__artifactId__-2</directory>
<includes>
<include>**/*.checkstyle</include>
<include>**/*.pmd</include>
<include>**/*.log</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>support/bin</directory>
<includes>
<include>**/*.bat</include>
<include>**/*.log</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>support/lib</directory>
<includes>
<include>**/*.jar</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>