You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alex McManus <al...@bigfoot.com> on 2005/10/30 13:27:26 UTC

Using Archetypes to Add to an Existing Project (Maven 2)

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Using Archetypes to Add to an Existing Project (Maven 2)

Posted by Jason van Zyl <ja...@maven.org>.
On Sun, 2005-10-30 at 19:58 +0000, Alex McManus wrote:
> Thanks once again for your quick response. I'm not entirely sure where 
> to look on Ibiblio, but in both of the following places, there is 
> nothing more recent than 1.0-alpha-3:
> 
> http://www.ibiblio.org/maven2/org/apache/maven/maven-archetype/
> http://www.ibiblio.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/
> 
> Has there been a hiccup in publishing alpha-4?

The site archetype:

http://www.ibiblio.org/maven2/org/apache/maven/archetypes/maven-
archetype-site/

I'm going to look over the archetype stuff, clean it up a bit and try to
resolve some issues and then release archetype itself along with all the
archetypes.

> Thanks,
> 
> Alex.
> 
> 
> Jason van Zyl wrote:
> 
> >On Sun, 2005-10-30 at 16:23 +0000, Alex McManus wrote:
> >  
> >
> >>Hi Jason,
> >>
> >>thanks very much for the helpful response. However, I have already been 
> >>looking at the quickstart guide. If I run the following sequence of 
> >>commands, copied directly from this guide:
> >>
> >>mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> >>mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app 
> >>-DarchetypeGroupId=org.apache.maven.archetypes 
> >>-DarchetypeArtifactId=maven-archetype-site
> >>
> >>...then I still get the "please run from a clean directory" error. 
> >>Because this happens before it attempts to download the 
> >>"maven-archetype-site" artefact, it suggests to me that the artefact 
> >>plugin isn't checking any settings in the archetype before throwing this 
> >>error. When I check my repository, I am using archetype plugin 
> >>"maven-archetype-1.0-alpha-3".
> >>    
> >>
> >
> >It is alpha-4 of the site archetype which allows generation within an
> >existing project. 
> >
> >  
> >
> >>Should I expect this to work with the 1.0-alpha-3 archetype plugin, or 
> >>is this such a new feature that it hasn't made it into a release yet?
> >>    
> >>
> >
> >You'll get the latest archetype plugin automatically, and the latest
> >site archetype should be coming down as well. Is alpha-4 not coming
> >down? If not try specifying the version and that should work. 
> >
> >  
> >
> >>Another thing that I'm curious about - when it is doing a partial create 
> >>of an archetype that contains a new POM (as the site archetype does), is 
> >>it clever about merging the new POM with the old. For example, will it 
> >>merge the dependencies in the archetype POM with those already in the 
> >>target project?
> >>    
> >>
> >
> >There's no logic like that yet, but certainly something we could do.
> >Right now when there is an existing project the POM is left as is.
> >
> >  
> >
> >>Thanks again,
> >>
> >>Alex.
> >>
> >>Jason van Zyl wrote:
> >>
> >>    
> >>
> >>>On Sun, 2005-10-30 at 12:27 +0000, Alex McManus wrote:
> >>> 
> >>>
> >>>      
> >>>
> >>>>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.
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>Correct.
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>First question: why do none of the core archetypes support partial 
> >>>>behaviour? 
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>It is a new feature that was added specifically for the getting started
> >>>guide so that a site can be added to an existing project. I also wanted
> >>>to be able to build up large projects but the site archetype was the
> >>>first stage. Just a matter of resources and time to adjust or add new
> >>>archetypes that can be additive. 
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>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. 
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>Absolutely.
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>Each of these archetypes creates discrete directories under 
> >>>>src that would seem to be able to co-exist with each other.
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>There are definitely cases where you don't want an archetype to be
> >>>partial but the site archetype and archetypes that might be used to
> >>>build up a j2ee app would are good examples of useful partial
> >>>archetypes.
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>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. 
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>You can use the quickstart archetype with the site archetype. The site
> >>>archetype is currently the only partial archetype. You can look at the
> >>>getting started guide where it's described:
> >>>
> >>>http://maven.apache.org/guides/getting-started/index.html
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>My apologies if I'm missing something blindingly obvious, any help would 
> >>>>be appreciated...
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>It's just that the archetypes haven't been adjusted yet.
> >>>
> >>> 
> >>>
> >>>      
> >>>
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

We know what we are, but know not what we may be.

  -- Shakespeare


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


Re: Using Archetypes to Add to an Existing Project (Maven 2)

Posted by Alex McManus <al...@bigfoot.com>.
Thanks once again for your quick response. I'm not entirely sure where 
to look on Ibiblio, but in both of the following places, there is 
nothing more recent than 1.0-alpha-3:

http://www.ibiblio.org/maven2/org/apache/maven/maven-archetype/
http://www.ibiblio.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/

Has there been a hiccup in publishing alpha-4?

Thanks,

Alex.


Jason van Zyl wrote:

>On Sun, 2005-10-30 at 16:23 +0000, Alex McManus wrote:
>  
>
>>Hi Jason,
>>
>>thanks very much for the helpful response. However, I have already been 
>>looking at the quickstart guide. If I run the following sequence of 
>>commands, copied directly from this guide:
>>
>>mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
>>mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app 
>>-DarchetypeGroupId=org.apache.maven.archetypes 
>>-DarchetypeArtifactId=maven-archetype-site
>>
>>...then I still get the "please run from a clean directory" error. 
>>Because this happens before it attempts to download the 
>>"maven-archetype-site" artefact, it suggests to me that the artefact 
>>plugin isn't checking any settings in the archetype before throwing this 
>>error. When I check my repository, I am using archetype plugin 
>>"maven-archetype-1.0-alpha-3".
>>    
>>
>
>It is alpha-4 of the site archetype which allows generation within an
>existing project. 
>
>  
>
>>Should I expect this to work with the 1.0-alpha-3 archetype plugin, or 
>>is this such a new feature that it hasn't made it into a release yet?
>>    
>>
>
>You'll get the latest archetype plugin automatically, and the latest
>site archetype should be coming down as well. Is alpha-4 not coming
>down? If not try specifying the version and that should work. 
>
>  
>
>>Another thing that I'm curious about - when it is doing a partial create 
>>of an archetype that contains a new POM (as the site archetype does), is 
>>it clever about merging the new POM with the old. For example, will it 
>>merge the dependencies in the archetype POM with those already in the 
>>target project?
>>    
>>
>
>There's no logic like that yet, but certainly something we could do.
>Right now when there is an existing project the POM is left as is.
>
>  
>
>>Thanks again,
>>
>>Alex.
>>
>>Jason van Zyl wrote:
>>
>>    
>>
>>>On Sun, 2005-10-30 at 12:27 +0000, Alex McManus wrote:
>>> 
>>>
>>>      
>>>
>>>>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.
>>>>   
>>>>
>>>>        
>>>>
>>>Correct.
>>>
>>> 
>>>
>>>      
>>>
>>>>First question: why do none of the core archetypes support partial 
>>>>behaviour? 
>>>>   
>>>>
>>>>        
>>>>
>>>It is a new feature that was added specifically for the getting started
>>>guide so that a site can be added to an existing project. I also wanted
>>>to be able to build up large projects but the site archetype was the
>>>first stage. Just a matter of resources and time to adjust or add new
>>>archetypes that can be additive. 
>>>
>>> 
>>>
>>>      
>>>
>>>>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. 
>>>>   
>>>>
>>>>        
>>>>
>>>Absolutely.
>>>
>>> 
>>>
>>>      
>>>
>>>>Each of these archetypes creates discrete directories under 
>>>>src that would seem to be able to co-exist with each other.
>>>>   
>>>>
>>>>        
>>>>
>>>There are definitely cases where you don't want an archetype to be
>>>partial but the site archetype and archetypes that might be used to
>>>build up a j2ee app would are good examples of useful partial
>>>archetypes.
>>>
>>> 
>>>
>>>      
>>>
>>>>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. 
>>>>   
>>>>
>>>>        
>>>>
>>>You can use the quickstart archetype with the site archetype. The site
>>>archetype is currently the only partial archetype. You can look at the
>>>getting started guide where it's described:
>>>
>>>http://maven.apache.org/guides/getting-started/index.html
>>>
>>> 
>>>
>>>      
>>>
>>>>My apologies if I'm missing something blindingly obvious, any help would 
>>>>be appreciated...
>>>>   
>>>>
>>>>        
>>>>
>>>It's just that the archetypes haven't been adjusted yet.
>>>
>>> 
>>>
>>>      
>>>

Re: Using Archetypes to Add to an Existing Project (Maven 2)

Posted by Jason van Zyl <ja...@maven.org>.
On Sun, 2005-10-30 at 16:23 +0000, Alex McManus wrote:
> Hi Jason,
> 
> thanks very much for the helpful response. However, I have already been 
> looking at the quickstart guide. If I run the following sequence of 
> commands, copied directly from this guide:
> 
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app 
> -DarchetypeGroupId=org.apache.maven.archetypes 
> -DarchetypeArtifactId=maven-archetype-site
> 
> ...then I still get the "please run from a clean directory" error. 
> Because this happens before it attempts to download the 
> "maven-archetype-site" artefact, it suggests to me that the artefact 
> plugin isn't checking any settings in the archetype before throwing this 
> error. When I check my repository, I am using archetype plugin 
> "maven-archetype-1.0-alpha-3".

It is alpha-4 of the site archetype which allows generation within an
existing project. 

> Should I expect this to work with the 1.0-alpha-3 archetype plugin, or 
> is this such a new feature that it hasn't made it into a release yet?

You'll get the latest archetype plugin automatically, and the latest
site archetype should be coming down as well. Is alpha-4 not coming
down? If not try specifying the version and that should work. 

> Another thing that I'm curious about - when it is doing a partial create 
> of an archetype that contains a new POM (as the site archetype does), is 
> it clever about merging the new POM with the old. For example, will it 
> merge the dependencies in the archetype POM with those already in the 
> target project?

There's no logic like that yet, but certainly something we could do.
Right now when there is an existing project the POM is left as is.

> Thanks again,
> 
> Alex.
> 
> Jason van Zyl wrote:
> 
> >On Sun, 2005-10-30 at 12:27 +0000, Alex McManus wrote:
> >  
> >
> >>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.
> >>    
> >>
> >
> >Correct.
> >
> >  
> >
> >>First question: why do none of the core archetypes support partial 
> >>behaviour? 
> >>    
> >>
> >
> >It is a new feature that was added specifically for the getting started
> >guide so that a site can be added to an existing project. I also wanted
> >to be able to build up large projects but the site archetype was the
> >first stage. Just a matter of resources and time to adjust or add new
> >archetypes that can be additive. 
> >
> >  
> >
> >>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. 
> >>    
> >>
> >
> >Absolutely.
> >
> >  
> >
> >>Each of these archetypes creates discrete directories under 
> >>src that would seem to be able to co-exist with each other.
> >>    
> >>
> >
> >There are definitely cases where you don't want an archetype to be
> >partial but the site archetype and archetypes that might be used to
> >build up a j2ee app would are good examples of useful partial
> >archetypes.
> >
> >  
> >
> >>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. 
> >>    
> >>
> >
> >You can use the quickstart archetype with the site archetype. The site
> >archetype is currently the only partial archetype. You can look at the
> >getting started guide where it's described:
> >
> >http://maven.apache.org/guides/getting-started/index.html
> >
> >  
> >
> >>My apologies if I'm missing something blindingly obvious, any help would 
> >>be appreciated...
> >>    
> >>
> >
> >It's just that the archetypes haven't been adjusted yet.
> >
> >  
> >
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

We all have problems. How we deal with them is a measure of our worth.

 -- Unknown


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


Re: Using Archetypes to Add to an Existing Project (Maven 2)

Posted by Alex McManus <al...@bigfoot.com>.
Hi Jason,

thanks very much for the helpful response. However, I have already been 
looking at the quickstart guide. If I run the following sequence of 
commands, copied directly from this guide:

mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app 
-DarchetypeGroupId=org.apache.maven.archetypes 
-DarchetypeArtifactId=maven-archetype-site

...then I still get the "please run from a clean directory" error. 
Because this happens before it attempts to download the 
"maven-archetype-site" artefact, it suggests to me that the artefact 
plugin isn't checking any settings in the archetype before throwing this 
error. When I check my repository, I am using archetype plugin 
"maven-archetype-1.0-alpha-3".

Should I expect this to work with the 1.0-alpha-3 archetype plugin, or 
is this such a new feature that it hasn't made it into a release yet?

Another thing that I'm curious about - when it is doing a partial create 
of an archetype that contains a new POM (as the site archetype does), is 
it clever about merging the new POM with the old. For example, will it 
merge the dependencies in the archetype POM with those already in the 
target project?

Thanks again,

Alex.

Jason van Zyl wrote:

>On Sun, 2005-10-30 at 12:27 +0000, Alex McManus wrote:
>  
>
>>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.
>>    
>>
>
>Correct.
>
>  
>
>>First question: why do none of the core archetypes support partial 
>>behaviour? 
>>    
>>
>
>It is a new feature that was added specifically for the getting started
>guide so that a site can be added to an existing project. I also wanted
>to be able to build up large projects but the site archetype was the
>first stage. Just a matter of resources and time to adjust or add new
>archetypes that can be additive. 
>
>  
>
>>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. 
>>    
>>
>
>Absolutely.
>
>  
>
>>Each of these archetypes creates discrete directories under 
>>src that would seem to be able to co-exist with each other.
>>    
>>
>
>There are definitely cases where you don't want an archetype to be
>partial but the site archetype and archetypes that might be used to
>build up a j2ee app would are good examples of useful partial
>archetypes.
>
>  
>
>>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. 
>>    
>>
>
>You can use the quickstart archetype with the site archetype. The site
>archetype is currently the only partial archetype. You can look at the
>getting started guide where it's described:
>
>http://maven.apache.org/guides/getting-started/index.html
>
>  
>
>>My apologies if I'm missing something blindingly obvious, any help would 
>>be appreciated...
>>    
>>
>
>It's just that the archetypes haven't been adjusted yet.
>
>  
>

Re: How to compile with Java 1.5?

Posted by Jason van Zyl <ja...@maven.org>.
On Sun, 2005-10-30 at 09:06 -0700, Siegfried Heintze wrote:
> How do I switch my m1 and m2 projects to use Java 1.5 instead of 1.3?
> 
> I preformed a google search and found
> http://maven.apache.org/reference/plugins/java/faq.html and now my
> project.properties file looks like this:
> 
> # Project property file for crawl_finance_yahoo
> maven.compile.source=1.5
> maven.compile.target=1.5
> 
> Unfortunately, my 1.5 "for loops" still don't compile from the command "mvn
> package". They do, however, compile and run (even in debug mode) from
> eclipse.

http://maven.apache.org/plugins/maven-compiler-plugin/howto.html

> 
> Thanks,
> Siegfried
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org



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


How to compile with Java 1.5?

Posted by Siegfried Heintze <si...@heintze.com>.
How do I switch my m1 and m2 projects to use Java 1.5 instead of 1.3?

I preformed a google search and found
http://maven.apache.org/reference/plugins/java/faq.html and now my
project.properties file looks like this:

# Project property file for crawl_finance_yahoo
maven.compile.source=1.5
maven.compile.target=1.5

Unfortunately, my 1.5 "for loops" still don't compile from the command "mvn
package". They do, however, compile and run (even in debug mode) from
eclipse.


Thanks,
Siegfried


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


Re: Where are Maven 2 Archetyptes documented?

Posted by Jason van Zyl <ja...@maven.org>.
On Sun, 2005-10-30 at 09:07 -0700, Siegfried Heintze wrote:
> I performed a google search on maven archetypes and could only find
> documentation on how to create my own. It seems that
> http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
> would be a logical place to store a list of archetypes.

Yes, I could put a small list there but archetypes are meant to be
distributed where m1 genapp templates are not. That means anyone can
create an archetype and deploy it to the central repository for
widespread use without any intervention on our part (aside from pushing
it into ibiblio).

> I'm still hopeful that all the templates for m1 are still available in some
> form for m2. I assume these are called archetypes in m2. Where are these
> templates documented for m2 and how do I use them? 

As yet most of the genapp templates are not in archetype form. Only so
much we can do at one time. We're looking for volunteers to create
archetypes. Currently there are only a few and they can be found here:

http://svn.apache.org/viewcvs.cgi/maven/components/trunk/maven-
archetype/maven-archetypes/

> Thanks,
> Siegfried
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

the course of true love never did run smooth ...

 -- Shakespeare


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


Where are Maven 2 Archetyptes documented?

Posted by Siegfried Heintze <si...@heintze.com>.
I performed a google search on maven archetypes and could only find
documentation on how to create my own. It seems that
http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
would be a logical place to store a list of archetypes.

I'm still hopeful that all the templates for m1 are still available in some
form for m2. I assume these are called archetypes in m2. Where are these
templates documented for m2 and how do I use them? 

Thanks,
Siegfried


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


Re: Using Archetypes to Add to an Existing Project (Maven 2)

Posted by Jason van Zyl <ja...@maven.org>.
On Sun, 2005-10-30 at 12:27 +0000, Alex McManus wrote:
> 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.

Correct.

> First question: why do none of the core archetypes support partial 
> behaviour? 

It is a new feature that was added specifically for the getting started
guide so that a site can be added to an existing project. I also wanted
to be able to build up large projects but the site archetype was the
first stage. Just a matter of resources and time to adjust or add new
archetypes that can be additive. 

> 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. 

Absolutely.

> Each of these archetypes creates discrete directories under 
> src that would seem to be able to co-exist with each other.

There are definitely cases where you don't want an archetype to be
partial but the site archetype and archetypes that might be used to
build up a j2ee app would are good examples of useful partial
archetypes.

> 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. 

You can use the quickstart archetype with the site archetype. The site
archetype is currently the only partial archetype. You can look at the
getting started guide where it's described:

http://maven.apache.org/guides/getting-started/index.html

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

It's just that the archetypes haven't been adjusted yet.

-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

We all have problems. How we deal with them is a measure of our worth.

 -- Unknown


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