You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by sanchit gupta <sa...@gmail.com> on 2014/06/30 09:44:29 UTC

Using Maven archetype for dynamic file creation

I am using  maven archetypes
<http://maven.apache.org/archetype/maven-archetype-plugin/>  for generation
of code and as given they also use Velocity. Velocity can be used for
dynamic file generation, it can use java objects and use there methods,
fields etc to generate dynamic file. However as far as maven archetype is
concerned I see that they are only capable of simple variable substitution
and a static file/folder structure.

   1.

   Is there a way to do processing prior to creating a project from an
   archetype, add java objects to the velocity context, and have the archetype
   templates be able to access them.
   2. Is there some documentation about how to use java objects with the
   maven archetype to generate dynamic file content?


-- 

Sincere Regards,
Sanchit Gupta

"A man is a success if he gets up in the morning and gets to bed at night,
and in between he does what he wants to do."
— Bob Dylan