The following comment has been added to this issue: Author: Ryan Hoegg Created: Mon, 18 Aug 2003 3:07 PM Body: Well I needed this functionality as well, so I decided to pick up where you left off.
I moved the contents of plugin-resources down into default/template-resources and added a template.properties file in default/. This file lets you define your directories to be repackaged and files to be filtered on a per-template basis. It also allows templates to preset things like project ID, name, and package (see below). I also removed the need to specify a package on the command line with -Dtemplate=package.name. Instead, I added a dependency on jelly:interaction and I prompt the user for a package name if one was not already defined. In addition, I made the project ID and name specifiable via command line properties or a prompt. I also scoped all property names from e.g. "template" to "maven.genapp.template" and "id" to "maven.genapp.template.id". Prompt language and defaults are in plugin.properties Possible shortcomings: - We depend on maven.genapp.repackage stuff to be in src/. A template might conceivably want its <unitTestSourceDirectory> somewhere else - We assume that maven.genapp.repackage includes only directory names. I can't think of a use case where this is bad. - We assume that maven.genapp.filter includes only file names, I think. I haven't tried using fileset patterns here. Attaching my changes. --------------------------------------------------------------------- View the issue: http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-426 Here is an overview of the issue: --------------------------------------------------------------------- Key: MAVEN-426 Summary: Allow genapp to support multiple templates Type: Improvement Status: Unassigned Priority: Major Time Spent: Unknown Remaining: Unknown Project: maven Fix Fors: 1.1 Versions: 1.0-beta-9 1.1 Assignee: Reporter: Brian Ewins Created: Wed, 14 May 2003 10:27 AM Updated: Sun, 3 Aug 2003 11:09 PM Environment: all Description: At the moment the genapp plugin is pretty rudimentary, you only get the 'standard' maven template project. I'd like maven to support multiple project templates, to make it easier to (for example) set up a beginner's webapp, ejb, maven-plugin project; a project with a standard setup for a company (logos, developers, scm); etc etc. Attached is some code to support this proposal. It changes the structure of the genapp 'plugin.resources' directory so that it more closely matches a normal project: plugin-resources/: project.properties project.xml src plugin-resources/src: conf java test plugin-resources/src/conf: app.properties plugin-resources/src/java: App.java plugin-resources/src/test: AbstractTestCase.java AppTest.java NaughtyTest.java Next we identify the three kinds of resource which need copied - those which need 'repackaged' like java, test; those which need filtered (project.xml), and those which just need copied (everything else). I do this by adding a plugin.properties with the lines: maven.genapp.repackage=java,test maven.genapp.filter=project.xml Finally I updated the plugin.jelly (attached). The plugin.jelly was written for b8, (hence the missing 'ant:' stuff) and takes an extra parameter: maven -Dpackage=blah -Dtemplate=example genapp this will try to copy the 'example' project from the user's home dir. This code isn't really sophisticated enough, it should try the user's home dir first then fall back on the plugin.resources dir, with the 'default' output of genapp moved to a project called 'default'; this would let maven ship with more examples (including a reactor example!) while giving the user a way to override them. If the comments on this idea involve more changes to the plugin I'd be happy to oblige. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]