Gisbert Amm wrote on Tuesday, September 14, 2004 11:32 AM:
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.
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
Hmm. This should work. Can you give it a try and define "maven.genapp.template.repository" manually (remember it points to the root of the templates)?
When I call
$> maven -b genapp -Dmaven.genapp.template.repository=/path_to_my_home/.maven/templates
all works fine.
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/myapp
What 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
This is wrong also. Please create an issue in JIRA.
Never mind, that was my own (sort of stupid) mistake.
When I called Maven I was actually *within* the template directory. Then it is not such a big surprise that the structure of the new project was generated within the template directory (probably the software should be aware of this possibility and warn the user about it - this could be an issue or enhancement report, if you like).
So the step-by-step guide for the creation of a new project would say:
1. Create a new directory (e.g. within your eclipse workspace) 2. Go *into* this directory 3. Call maven genapp ... and so on
I could write some of this documentation for the genapp plugin site if you like.
Thanks for your help, Gisbert
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
