Gisbert Amm wrote on Monday, September 13, 2004 7:20 PM:
I want to create my own customized template based on the web template so that I can call "maven genapp myapp" to create customized projects.
Have a look at the properties: http://maven.apache.org/reference/plugins/genapp/properties.html
By default Maven searches also templates in the directory ${maven.local.home}/templates i.e. $HOME/.maven/templates. Create subdirectories there (the name of the template equals the directory name), that have own template.jelly scripts. Have a look at the resources of genapp itself to see how a template is written.
Thanks for the quick response. Now I understand.
I did jar -xvf ~/maven-1.0/plugins/maven-genapp-plugin-2.2.jar and do now find a direcory "web" within "plugin-resources" which actually *is* the template for a web application.
I now can copy this directory to $HOME/.maven/templates/myapp (or whatever) and then adapt the template.properties according to http://maven.apache.org/reference/plugins/genapp/properties.html to meet my needs and change the content of the template-resources directory which will actually be the content of each new project based on this template.
So far this is straight forward and I just tried it out.
But when I call
$> maven -b genapp Enter a project template to use: [default] myapp
I get:
BUILD FAILED
File...... /path_to_my_home/.maven/cache/maven-genapp-plugin-2.2/plugin.jelly
Element... fail
Line...... 64
Column.... 15
Unable to locate a template named myapp
When I try
$> maven -b genapp -Dmaven.genapp.template.dir=/path_to_my_home/.maven/templates/myapp
at first all seems to work:
Please specify an id for your application: [app] hi Please specify a name for your application: [Example Application] Hi Please specify the package for your application: [my.example]
build:start:
But the files are copied into the template itself:
genapp:
[copy] Copying 1 file to /path_to_my_home/.maven/templates/myapp
/src/java/my/example
[copy] Copying 1 file to /path_to_my_home/.maven/templates/myapp
/src/test/my/example
[copy] Copying 2 files to /path_to_my_home/.maven/templates/myapp
/src/test-cactus/my/example
[copy] Copying 2 files to /path_to_my_home/.maven/templates/myapp
[copy] Copying 5 files to /path_to_my_home/.maven/templates/myappWhat am I doing wrong here? I'm using the current binary from the Maven download site with JRE 1.4.2-b28 on a SuSE Linux 8.1 Machine. My MAVEN_HOME is set to /path_to_my_home/maven-1.0
Regards, Gisbert Amm
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
