Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make my archetype from a multimodule project use directories that are based on the artifactId?
    text
    copied!<p>I have create an archetype using archetype:create-from-project out of a multi module project.</p> <p>The archetype-metadata.xml is like below, what I would want is that the "dir" can be modified when I run mvn archetype:generate by using the archetypeId I provide instead of using a fixed dir. Can that be done?</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;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"&gt; &lt;modules&gt; &lt;module id="service-def" dir="service-def" name="service-def"&gt; &lt;fileSets&gt; &lt;fileSet filtered="true" packaged="true" encoding="UTF-8"&gt; &lt;directory&gt;src/main/java&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**/*.java&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;/fileSets&gt; &lt;/module&gt; &lt;module id="service" dir="service" name="service"&gt; &lt;fileSets&gt; &lt;fileSet filtered="true" packaged="true" encoding="UTF-8"&gt; &lt;directory&gt;src/main/java&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**/*.java&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;fileSet filtered="true" packaged="true" encoding="UTF-8"&gt; &lt;directory&gt;src/test/java&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**/*.java&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;fileSet filtered="true" encoding="UTF-8"&gt; &lt;directory&gt;src/test/resources&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**/*.xml&lt;/include&gt; &lt;include&gt;**/*.properties&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;fileSet encoding="UTF-8"&gt; &lt;directory&gt;src/test/resources&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**/*.sql&lt;/include&gt; &lt;include&gt;**/*.dtd&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;/fileSets&gt; &lt;/module&gt; &lt;module id="service-web" dir="service-web" name="service-web"&gt; &lt;fileSets&gt; &lt;fileSet filtered="true" encoding="UTF-8"&gt; &lt;directory&gt;src/main/webapp&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**/*.xml&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;fileSet filtered="true" encoding="UTF-8"&gt; &lt;directory&gt;src/main/resources&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**/*.xml&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;/fileSets&gt; &lt;/module&gt; &lt;/modules&gt; &lt;/archetype-descriptor&gt; </code></pre> <p>This is the structure of the archetype:</p> <pre><code> ├── 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 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload