Is there an existing way to dynamically add code to a java class when
creating from an archetype?  What I would like to do is have the user pass
me a properties file with entries like
  name=String
  age=Integer
  ?=?
And then for the MyBean.java class put in the getters and setters for it.  I
can easily do this if I knew all of the fields beforehand but this is a
variable list.

If there isn't an existing way or an example what do people think about
extending DefaultArchetypeCreationQueryer's askReplacementValue and if the
supplied propertyKey starts with "java_" to take that to be a class name
with the defaultValue being a properties file to give to this class, getting
back a String of the code I want to put into the ${myBeanCode} velocity
marker?

Or is it better to create another Mojo that runs after the java source file
is copied over and then replace the ${myBeanCode} marker?
-- 
View this message in context: 
http://www.nabble.com/Ability-to-insert-generate-code-during-archetype-generate--tp25151418p25151418.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to