Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

"mvn archetype:generate" via a pom instead of command line.  RSS feed

Gaurav Upadhyay
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i wrote a custom Maven archetype. The archetype works just fine when i try to invoke it through the command line. I even have some custom properties that i pass ad -D parameters when i use it from the command line.

Is there a way to invoke a custom maven archetype from another pom. Just like another plugin within a pom? I tried using the maven-archetype-plugin's generate goal. The place where i get stuck is on how to pass my custom properties in the plugin <configuration>. Via the command line, this is as easy as passing a -D. If i mention the property directly under configuration, the plugin ignores it.

Please advice on how to invoke the maven archetype plugin's generate goal with custom properties. For example,

the first property is defined in the plugin's configuration, so its taken well. However, the custom property is ignored. How do i get the plugin to take custom properties, like it does when we invoke it from the command line and pass the property as -D.?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!