Tuesday, September 21, 2010

How to find desired Maven archetype?

To search for the Maven archetype you need, display list of all available ones from of the selected catalogs:

hekonsek@jorge:/tmp$ mvn archetype:generate -DarchetypeCatalog=internal,remote,local | grep -i camel
47: remote -> camel-component (null)
48: remote -> camel-router (null)
49: remote -> camel-archetype-activemq (Creates a new Camel project that configures and interacts with ActiveMQ.)
50: remote -> camel-archetype-component (Creates a new Camel component.)
51: remote -> camel-archetype-java (Creates a new Camel project using Java DSL.)
52: remote -> camel-archetype-scala (Creates a new Camel project using Scala DSL.)
53: remote -> camel-archetype-spring (Creates a new Camel project with added Spring DSL support.)
54: remote -> camel-archetype-war (Creates a new Camel project that deploys the Camel Web Console, REST API, and your routes as a WAR)
98: remote -> servicemix-camel-service-unit (null)

Now you can execute Maven in interctive mode and enter id of the desired artifact:

hekonsek@jorge:/tmp$ mvn archetype:generate
Choose archetype:
Choose a number: 80: 98
Choose version: 
1: 3.2
2: 3.2.1
3: 3.2.2
4: 3.2.3
Choose a number: : 4
Define value for property 'groupId': : foo
Define value for property 'artifactId': : bar
Define value for property 'version': 1.0-SNAPSHOT:

Ta-da! Project from archetype is ready to go.

No comments:

Post a Comment