I'm just getting to grips with Maven for the first time, and having some difficulties getting archetypes to add files to an existing project. If I understand things correctly, archetypes can also be used to add files to an existing project, as well as to create a new one from scratch. This is controlled via the <allowPartial> element in the archetype.xml file.

First question: why do none of the core archetypes support partial behaviour? It seems to make sense that I can use the quickstart archetype to setup my initial project, then add web capabilities with the webapp archetype, and then add site documentation with the site archetype. Each of these archetypes creates discrete directories under src that would seem to be able to co-exist with each other.

If I run...

mvn archetype:create -DgroupId=test -DartifactId=test
mvn archetype:create -DgroupId=test -DartifactId=test -DarchetypeGroupId=org.apache.maven.archetypes-DarchetypeArtifactId=maven-archetype-webapp

...it gives the following error...

[INFO] ----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] test already exists - please run from a clean directory
[INFO] ----------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ----------------------------------------------------------------------------

Second question: does anyone have the allowPartial behaviour working in an archetype (and are there any examples that I can look at)? I've tried to setup some simple examples, but I always get the some error as above. If you run any of the core archetypes from a clean Maven installation (i.e. empty local repository), it seems to give the error before it actually downloads the archetype, which suggests that this error is generated by the plugin irrespective of any setting in the archetype.

I am using Maven 2.0 on Windows XP.

My apologies if I'm missing something blindingly obvious, any help would be appreciated...

Alex.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to