Gracelets - Application Setup SourceForge.net Logo

Tutorial - Setup your application environment


NOTE: If you have used/downloaded the archetype before January 17th, 2010, you will need to remove that copy from your maven repository and follow the setup instructions over again.
Getting setup to use Gracelets is even easier now with Maven 2. There is a Maven 2 Archive Type (archetype) Catalog available on the main site in order to get your environment setup quickly and dive into writing an application.

The URL for the Archive Type Catalog is http://gracelets.sourceforge.net/archetype-catalog.xml. You can use this in connection with the "archetype:generate" target for Maven 2, on the command line as show below.


C:\>cd gracelets

C:\gracelets>mvn archetype:generate -DarchetypeCatalog=http://gracelets.sourceforge.net/archetype-catalog.xml
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:generate]
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://gracelets.sourceforge.net/archetype-catalog.xml -> standard-gracelets-2.0 (Standard Gracelets 2.0 WebARchive)
Choose a number: (1):


You simply type 1 and 'Enter' to begin the process of creating your mavenized Gracelet's application. You will be asked for the group and artifact names along with the version of your new project. Then you will be asked to confirm the information, afterwhich your project will be generated.

You can also easily set this up in Eclipse IDE and the Maven Eclipse Plugin as shown in the following screen shots (made using Eclipse IDE version 3.5.0 build I20090515-1143 and Maven 2 Plugin 0.9.9 build 12160759 from Sonatype, Inc.):

Step 1 -

To add the Gracelets catalog to the Maven Plugin catalog list you can add it via the Preferences page. First as shown below, you click on Window -> Preferences.


Step 2 -

Then under Maven -> Archetypes you click on the 'Add Remote Catalog...' button.


Step 3 -

Next enter the archetype-catalog URL, which is http://gracelets.sourceforge.net/archetype-catalog.xml, the name of the catalog and click on 'Verify' and you should see the message 'Found 1 archetype(s)'. You can then exit out of those windows.


Step 4 -

Now you are ready to create a Gracelets Mavenized WAR project. Right click and choose New -> Project...


Step 5 -

Then select the Maven Project wizard


Step 6 -

Here simply hit Next


Step 7 -

Choose the Gracelets catalog that we created previously


Step 8 -

Then enter the name of your application group, artifact and version info along with the class package name


Project Created

You should have a directory structure like below