On Mon, 2005-09-26 at 21:49 -0400, Eric Jacob wrote: > Hi, > > The M1 Genapp plugin offers the possibility to define custom parameters and > templates... So here my questions about the M2 Archetype plugin: > > (1) Does it offer the same possibilities?
Yes, the templates for a archetype are actually velocity templates so more flexible then what's in genapp. > (2) Is it possible to prompt the user for the parameter's value? Archetypes were designed to do that. The parameters can come from anywhere as long they end up in a Map. The Map is used when rendering the velocity templates to parameterize the output. I would like to do more work on the archetypes in order to provide some metadata about the parameters for a particular archetype so that better UI tools can be made. But even with that being the case there is reason why you couldn't make a UI for the generation of a project from an archetype. > (3) Where should I start to build my own template? You can look at the existing archetypes which are simply JARs that contain velocity templates and some metadata about what is actually in the archetype. I will add some doco to the getting started guide about archetypes as I think there is little known about them but they are going to be highly useful. If you follow the current getting started guide and create a project: m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app This will actually download the archetype to your local maven repository and you can take a look at it. It will be in: $repo/org/apache/maven/archetypes/maven-archetype-quickstart/1.0-alpha-3 > (4) Finally, how to add a specific "script/behaviour" to a template in M2? The templates are velocity templates so you get the directives that velocity provides and you can make your own velocity macros or tools. A tool is simply a Java object that you drop into a velocity context so you can really do whatever you want. I would think velocity itself would give you enough flexibility. > Thanks, > > Eric -- jvz. Jason van Zyl jason at maven.org http://maven.apache.org In short, man creates for himself a new religion of a rational and technical order to justify his work and to be justified in it. -- Jacques Ellul, The Technological Society --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
