I am using Maven3 to make a web project based GWT and Spring, How to make custom archetype to include dependencies for both?
1 Answer
Guide to Creating Archetypes
Creating an archetype is a pretty straight forward process. An archetype is a very simple artifact, that contains the project prototype you wish to create. An archetype is made up of:
- An archetype descriptor (archetype.xml in directory: src/main/resources/META-INF/maven/). It lists all the files that will be contained in the archetype and categorizes them so they can be processed correctly by the archetype generation mechanism.
- The prototype files that are copied by the archetype plugin (directory: src/main/resources/archetype-resources/)
- The prototype pom (pom.xml in: src/main/resources/archetype-resources)
- A pom for the archetype (pom.xml in the archetype's root directory). Note: this mini-guide has been written for archetype plugin version 1.0.x, with its old archetype descriptor (stored in archetype.xml file). Archetype plugin 2.0.x is a new generation that fully supports archetypes created for 1.0.x, and adds a new archetype descriptor (stored in archetype-metadata.xml file): it's more flexible, has more features, but the basis is absolutely the same.
To create an archetype follow these steps:
1. Create a new project and pom.xml for the archetype artifact
2. Create the archetype descriptor
3. Create the prototype files and the prototype pom.xml
4. Install the archetype and run the archetype plugin
Reference: http://maven.apache.org/guides/mini/guide-creating-archetypes.html
And this is exactly what you want: Maven Archetype for GWT and Spring framework project: https://code.google.com/p/gwt-spring-archetype/ You can see source code, then modify this for newer dependencies.