You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Bill Milligan <bi...@gmail.com> on 2009/06/18 02:56:11 UTC

Re: Problem with multi-module archetype


Hi Jason,

I hit the same issue.  I hope you raised a JIRA!

Since I'm impatient and can't wait for a resolution, I'm planning on getting
around it by renaming directories and module names in my root pom via an ant
task bound to the process-sources phase of my archetype build.

Here's hoping it works!

The biggest lack in working with creating maven archetypes is the complete
and utter lack of good documentation.  The maven-archetype plugin page's
quick start guide to creating archetypes is literally years out of date.  I
just found out about the need to use ${rootArtifactId} instead of
${artifactId} in modules (the latter outputs the archetype's artifactId of
all damn things).  How did I find out about this?  By vgrepping
archetype-commons source code!  This is not friendly.

</biching-and-moaning>


Jason Voegele wrote:
> 
> Hello again maven-archetype gurus.
> 
> I am working on an archetype where the generated project should have the 
> following structure:
> 
> foo
> |-- pom.xml
> |-- src
> |   |-- test
> |   |   `-- java
> |   `-- main
> |       `-- java
> `-- foo-system-tests
>     |-- pom.xml
>     `-- src
>         `-- test
>             `-- java
> 
> The idea is that the main project 'foo' will have its code and unit tests
> in 
> the top-level module, and there will be a separate module
> 'foo-system-tests' 
> that contains integration tests for foo.  Because 'foo' produces an actual
> JAR 
> artifact, its packaging type must be "jar" and it therefore cannot have
> any 
> submodules in the strict sense of having <module> elements in its POM.  
> Therefore I've crafted the POMs such that the top-level foo pom.xml would 
> invoke the integration tests via the maven-invoker-plugin instead.
> 
> The problem is that even though this structure should work fine in a Maven 
> build, the archetype plugin fails when it tries to generate the project
> with 
> this structure, because it attempts to add the 'foo-system-tests'
> subdirectory 
> to the top-level POM as a <module>.  This fails because the top-level POM
> is 
> packaging=jar instead of packaging=pom.
> 
> I presume this is happening because I have declared the foo-system-tests 
> subdirectory as a module in the archetype-metadata.xml:
> 
> <module id="${rootArtifactId}-system-tests"
>         dir="__rootArtifactId__-system-tests"
>         name="${rootArtifactId}-system-tests">
> 
> My intent is that whatever the user chooses for the artifactId when
> generating 
> the project will result in the ${artifactId}-system-tests subdirectory
> being 
> created.  I don't really want it to be added as a <module> to the
> top-level 
> POM, however, since that results in a failure.  Is it possible to
> accomplish 
> what I am attempting with the maven-archetype-plugin?
> 
> Thanks for any help you can provide.
> 
> -- 
> Jason Voegele
> "Text processing has made it possible to right-justify any idea, even
> one which cannot be justified on any other grounds."
> 		-- J. Finnegan, USC.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-multi-module-archetype-tp22959547p24084721.html
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org