Issue Details (XML | Word | Printable)

Key: ARCHETYPE-23
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Jason van Zyl
Reporter: Johannes Carlén
Votes: 9
Watchers: 11
Operations

If you were logged in you would be able to see more operations.
Maven Archetype

Possibility to create real multiple modules with Java sources

Created: 10/Jan/06 09:37 AM   Updated: 04/Nov/07 01:28 AM
Component/s: Plugin
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. File archetype.mdo (3 kB)
2. Java Source File DefaultArchetype.java (24 kB)
3. Java Source File MavenArchetypeMojo.java (7 kB)

Issue Links:
Supercedes
 


 Description  « Hide
I'm lacking the possibility to be able to generate a real multimodule application i.e. an ear containing both a web module and an ejb module with java sources.

I know it is possible to list all classes as a <resource>, however when doing so I can't get the packageName to automatically be prepended to the java files path (src/main/java/<package>/.../App.java).

What it means is that I'd like to be able to mark the java files as source files also when doing multiple modules generations.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Johannes Carlén added a comment - 10/Jan/06 09:54 AM
Also somewhat related to this...

How about creating Java sources in different subpackages such as ${package}\model or ${package}\web ?


John Didion added a comment - 01/Feb/06 01:35 PM
I've modified archetype-core and archetype-plugin to provide this functionality for our projects. I'll attache the code I modified to get this to work. Here's an example of a multi-module archetype.xml:
<?xml version="1.0"?>
<archetype xmlns="http://maven.apache.org/Archetype/1.0.0">
  <id>archetype-webservice</id>
  <modules>
    <module>
      <dir>api</dir>
      <sources>
        <source>src/main/java/readme.txt</source>
      </sources>
    </module>
    <module>
      <dir>impl</dir>
      <sources>
        <source>src/main/java/readme.txt</source>
      </sources>
      <resources>
        <resource>src/main/resources/readme.txt</resource>
        <resource>src/main/resources/META-INF/PropertyMetadata.xml</resource>
        <resource>src/main/sql/readme.txt</resource>
      </resources>
      <testSources>
        <testSource>src/test/java/readme.txt</testSource>
      </testSources>
      <testResources>
        <testResource>src/test/resources/readme.txt</testResource>
        <testResource>src/test/sql/readme.txt</testResource>
      </testResources>
      <siteResources>
        <siteResource>src/site/site.xml</siteResource>
        <siteResource>src/site/apt/index.apt</siteResource>
      </siteResources>
    </module>
    <module>
      <dir>client</dir>
    </module>
    <module>
      <dir>webapp</dir>
      <resources>
        <resource>src/main/resources/log4j.xml</resource>
        <resource>src/main/webapp/WEB-INF/web.xml</resource>
      </resources>
      <testSources>
        <testSource>src/test/java/readme.txt</testSource>
      </testSources>
    </module>
  </modules>
</archetype>

John Didion added a comment - 01/Feb/06 01:37 PM
Files I modified to provide multi-module archetype functionality.

Brett Porter added a comment - 03/Apr/06 07:16 AM
John, this looks like a good change (including using modello), but the attached files are only part of the picture, and the plugin has changed since 1 Feb. I don't have time to manually implement this for the 1.0-alpha-4 version, but I'm sure Jason will add similar functionality to the next version.

Casey Butterworth added a comment - 23/Jul/07 07:57 AM
I see that ARCHETYPE-33 is said to supercede this issue, but I can't see whether it has been released as the new archetype plugin. Any idea when this might happen? I'd love to provide a multi module maven archetype for our projects and at this stage am unable to.

Raphaël Piéroni added a comment - 24/Jul/07 12:06 PM
This issue will be fixed by NG-alpha-1

Jason van Zyl added a comment - 04/Nov/07 01:28 AM
Addressed in ArchetypeNG.