Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter archetypes in Maven command line with archetype:generate

When trying to generate a Maven project from an archetype (using mvn archetype:generate), the command returns a lots of archetypes.

Is there a way to filter archetypes given a word (contained in groupId or artifactId)?

I know you can actually create a project with a specific archetype, with arguments like -DgroupID=org.domain -DartifactId=sample, but it's not what I'm looking for.

like image 417
Brian Clozel Avatar asked Jul 13 '11 09:07

Brian Clozel


1 Answers

Ok. A bug as been filed and should be resolved in Maven archetype plugin version 2.1.

Edit:

Bug is solved in maven-archetype-plugin version 2.1. Documentation is ready.

mvn archetype:generate -Dfilter=org.apache:struts

For a groupId containing org.apache AND an artifactId containing struts

like image 79
Brian Clozel Avatar answered Sep 22 '22 19:09

Brian Clozel