maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier DAUMAS <krysa.l...@gmail.com>
Subject Maven Archetype Generate using my own property
Date Mon, 25 Mar 2013 10:44:27 GMT
Hi,

I am trying to generate artefact from maven archetype and I would like to
generate some basic java classes depending on parameters given in the
command line.
call mvn archetype:generate -B -X -DarchetypeGroupId=myarchetypegroupid
-DarchetypeArtifactId=myarchetype -DarchetypeVersion=1.0-SNAPSHOT
-DgroupId=mygroupid -DartifactId=myartefact -Dversion=myversion
-Dpackage=com.amadeus.jcp.ui.modules.%MODULE% --Dmodulename=%MODULE%
-DclassName=%CLASSNAME%

Typically I need to be able to pass extra parameter that velocity will used
to filter some of the file contained into the archetype and will lead to
final java object with specific names.
But only some of them like groupid and artefactid are available in velocity
filtering.

package com.amadeus.jcp.ui.modules.${modulename};
public class public class ${className}Handler{
private static final Logger s_logger = LoggerFactory
.getLogger(${className}Handler.class);

....

Do you have any idea how to manage passing my own variables ?

Olivier

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message