Hi You can find an example of partial archetype in http://svn.apache.org/repos/asf/maven/archetype/trunk/archetype-common/src/test/archetypes/partial-1.0/
You can find some unit tests using that archetype in http://svn.apache.org/repos/asf/maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/generator/DefaultArchetypeGeneratorTest.java Regards, Raphaël 2009/4/23 Yopy <[email protected]> > > Hi all, I'm having issues with the Archetype plugin. > > I've made an archetype that sets up a 'skeleton' application, which can be > packaged as an OSGI module and distributed. This works fine, no problems > there (yet, and the problems that were there I have managed to solve). > > The next step is to add 'components' to this module. A component, in this > case, is a set of classes and resources added to the project's src folder. > I > figured that partial archetypes would - in theory - do the trick, but I'm > having trouble with that. > > The first problem is that there doesn't seem to be proper documentation on > the subject. There is some documentation available on the archetype > creation > process, but it's limited and whatnot. There's also no or very little > documentation on creating and using a partial archetype - the one I found > was for an older version, it seems, where the archetype configuration file > was still called 'archetype.xml' instead of the current > 'archetype-metadata.xml'. > > But anyways. I've made my archetype's source which is mainly out of a > source > folder that adds a set of classes to the package the user indicates on the > commandline. I've also had to add a pom.xml file in the root of the > archetype-resources folder, else the archetype would not install. > > I've added an <allowPartial>-tag to the archetype-metadata.xml, guessing > that's what you have to add to this file in order to make it a partial > project - please correct me if I'm wrong. > > Next, I go to the commandline, mvn archetype:generate my skeleton project, > works fine. Next, I archetype:generate the 'partial' archetype, but that's > where the problems begin. > > When calling the archetype:generate command with the partial archetype, I > get the error that there is already a Maven2 project with the same name as > the archetypeId. It doesn't seem like I can leave this value blank, either. > > The next attempt is to go into the project skeleton directory and call the > command there, but then I get the error that Maven is 'unable to add module > to the current project as it is not of packaging type 'pom''. > > I'm starting to suspect that the 'partial' archetype can only add full > modules to a Maven project - is this suspicion correct? > > If not, then what might I be doing wrong? What is required to create a > partial archetype that (attempts to) add files and folders to an existing > project's src folder? What should the archetype's prototype pom.xml contain > (if anything)? What data should I - besides the fileSets and whatnot - add > to the archetype-metadata.xml file? > > [/questions] > > It'd help a ton if there would be someone that could help me out, :). > > Kind regards, > -- > View this message in context: > http://www.nabble.com/-Archetype--Adding-a-package-to-an-existing-project-tp23194570p23194570.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
