maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex McManus <alexmcma...@bigfoot.com>
Subject Re: Using Archetypes to Add to an Existing Project (Maven 2)
Date Sun, 30 Oct 2005 19:58:00 GMT
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.
>>>
>>> 
>>>
>>>      
>>>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message