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: [email protected]
For additional commands, e-mail: [email protected]