I created an archetype using archetype: create-from-project from a project with several modules.
The archetype-metadata.xml is similar to below, I would like the βdirβ to be able to change when I run mvn archetype: generate using the archetypeId that I provide, instead of using a fixed directory. It can be done?
<?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="service-parent"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modules>
<module id="service-def" dir="service-def" name="service-def">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="service" dir="service" name="service">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/test/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/test/resources</directory>
<includes>
<include>**/*.sql</include>
<include>**/*.dtd</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="service-web" dir="service-web" name="service-web">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/webapp</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
</fileSets>
</module>
</modules>
</archetype-descriptor>
This is the structure of the archetype:
βββ pom.xml
βββ src
βββ main
β βββ resources
β βββ archetype-resources
β β βββ pom.xml
β β βββ service
β β β βββ pom.xml
β β β βββ src
β β β βββ main
β β β β βββ java
β β β βββ test
β β β βββ java
β β β βββ resources
β β βββ service-def
β β β βββ pom.xml
β β β βββ src
β β β βββ main
β β β βββ java
β β βββ service-web
β β βββ pom.xml
β β βββ src
β β βββ main
β β βββ resources
β β β βββ dao-context.xml
β β β βββ hibernate.cfg.xml
β β β βββ single-context.xml
β β βββ webapp
β β βββ WEB-INF
β β βββ jboss-web.xml
β β βββ remoting-servlet.xml
β β βββ web.xml
β βββ META-INF
β βββ maven
β βββ archetype-metadata.xml
βββ test
βββ resources
βββ projects
βββ basic
βββ archetype.properties
βββ goal.txt
source
share