Creating a custom module skeleton using a Maven Archetype
Using Maven2, you can quickly getting started in creating a module, by using the archetype plugin and the magnolia-module archetype.
This will create a basic skeleton/structure for your module.
Note: There's a bug in the latest Archetype Plugin that causes the commands below to fail. If you use mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create instead of mvn archetype:create, it should solve this problem. We apologize for the inconvenience and hope this will be fixed soon. ( source: http://appfuse.org/display/APF/AppFuse+QuickStart )
Use this command:
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -DarchetypeGroupId=info.magnolia \
-DarchetypeArtifactId=maven-archetype-magnolia-module \
-DarchetypeVersion=1.0 \
-DremoteRepositories=http: -DgroupId=com.foo.bar \
-DartifactId=my-module
Where com.foo.bar is your maven groupId and my-module will be the artifactId of your new module.
Due to limitation of the archetype mechanism in Maven, some folder and filenames had to be hardcoded to "mymodule". Hopefully, archetype-ng will help address these issues; if you have experience with this, please contribute !
Creating a custom webapp skeleton using a Maven Archetype
An archetype also exists to generate a basic webapp skeleton that will have a dependency upon the Magnolia 3.5 empty-webapp package.
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -DarchetypeGroupId=info.magnolia \
-DarchetypeArtifactId=maven-archetype-magnolia-webapp \
-DarchetypeVersion=1.0 \
-DremoteRepositories=http: -DgroupId=com.foo.bar \
-DartifactId=my-webapp
modify the parameters such as your groupId and artifactId appropriately.
Please try it out and tell us what you think !
More info about Maven artifacts:
http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
http://maven.apache.org/guides/mini/guide-creating-archetypes.html