Has anyone ever stopped and gazed at the marvellous wonder called Maven? It slices, it dices and I bet that if it were included, it would even play Office Space for you. All you need to do is point it at the nearest sensible "settings.xml" and issue a command.
mvn -s settings.xml -P configure-jcr-repository mvn -s settings.xml -P create-mysql-db
These babies configure your JCR repository and create a freshly initialized MySQL database for you. You only have to do this when you are setting up a fresh site.
mvn -s settings.xml -P build-project clean package
mvn -s settings.xml -P run-project
mvn -s settings.xml -P configure-tomcat
By now, you will have noticed the recurring "-s settings.xml" in the commandline. That settings file is where Maven retrieves its smartness from (actually, that and several "pom.xml" files). It is up to you to make sure the settings are correct for your environment. Once you have a good "settings.xml file", you can use it from other directories by using the whole path name. The following examples assume there is a "C:\GX\WebManager9\settings.xml" to use.
The following command will create a brand spanking new presentation template for you to fill in:
mvn archetype:create -DarchetypeGroupId=nl.gx.webmanager.archetypes -DarchetypeArtifactId=webmanager-presentation-archetype -DarchetypeVersion=9.3.3 -DgroupId=helloworld -DartifactId=helloworldpresentation -DpackageName=nl.gx.product -s C:\GX\WebManager9\settings.xml
There are more templates to help you out. Check the Quick Start Guide for the others.
And since you are developing, you will probably want to use Eclipse, so we might as well generate a .project configuration file for it:mvn -s C:\GX\WebManager9\settings.xml eclipse:eclipse
When you are done developing, build and package your WCB using:
mvn -s C:\GX\WebManager9\settings.xml clean package
A freshly baked "helloworldpresentation-1.0.jar" file will appear in the "target" directory. Upload to WebManager with the WCB Management console and you are ready to admire your work.
Finally, when you are ready to deploy everything to a production environment, there is one last thing Maven can do to assist you:
mvn -s productionsettings.xml -P build-deploy clean package assembly:assembly
As you can see, there are numerous reasons to love Maven in combination with GX WebManager!
Ah well, it was worth a shot... Till next time!
Greetings,
Patrick
Patrick Atoon has gained nuff respect as one of the most experienced web architects in the GX Webmanager community or even the global hip hop community for that matter.
Read all Patricks blog entries
Other blog entries: