Outils Maven, J2EE, et archetypes

Rien de bien compliqué ici… Vous travaillez sur des applications web J2EE (clients légers) et vous utilisez Maven. Ce qui suit peut alors vous intéresser. Pour les autres, c’est le temps de découvrir de nouveaux outils…

C’est quoi Maven ?

Maven est un outil open-source de build, un peu à la maniére d’Ant (mais plus puissant) pour les projets Java.
Conçu pour supprimer les tâches difficiles du processus de build, Maven utilise une approche déclarative, où le contenu et la structure du projet sont décrits, plutôt qu’une approche par tâche utilisée par exemple par Ant ou les fichiers make traditionnels.

Maven gère les dépendances simplement via quelques lignes de code. Il n’est plus question de télécharger vos archives, vos librairies mais simplement d’indiquer lesquelles vous utilisez dans votre projet pour que Maven les télécharges et les ajoutes au « build path ». Vous trouverez un excellent article de présentation sur développez.com.
code source
Donc Maven est un outil bien pratique. Vous développez des applications Web J2EE et vous souhaitez utiliser le fameux builder pour vos applis. Il existe des architectures types (archetypes) d’applications Web pour Maven. Cela simplifie le démarrage de projets Web. Les voicis :
ActiveMQThis archetype allows you to generate a template for a web application that uses ActiveMQ. The sample webapp allows a user to type in and send a message which will then be added to a Message Log.

Source: maven-archetype-ActiveMQ.zip
Artifact ID: maven-archetype-ActiveMQ
Version: 5.0.0

DOJOThis archetype allows you to generate a template for a web application that uses DOJO. The sample webapp displays « Hello World! » that the user may fade out or fade in.

Source: maven-archetype-DOJO.zip
Artifact ID: maven-archetype-DOJO
Version: 1.0.2

cometdThis archetype allows you to generate a template for a web application that uses cometd using jetty’s ContinuationCometdServlet. The sample webapp echoes messages being sent to the server back to the client.

Source: maven-archetype-cometd.zip
Artifact ID: maven-archetype-cometd
Version: cometd-api: 0.9.20071211, cometd-bayeux: 6.1.7, jetty: 6.1.7

DWRThis archetype allows you to generate a template for a web application that uses DWR. The sample webapp allows the user to enter his name to display a customized « Hello World » greeting.

Source: maven-archetype-DWR.zip
Artifact ID: maven-archetype-DWR
Version: 2.0.2

JSFThis archetype allows you to generate a template for a web application that uses JSF. The sample webapp allows the user to enter his name to display a customized « Hello » greeting.

Source: maven-archetype-JSF.zip
Artifact ID: maven-archetype-JSF
Version: 1.2_07

SiteMeshThis archetype allows you to generate a template for a web application that uses SiteMesh. The sample webapp displays « Hello world! » and the current date.

Source: maven-archetype-SiteMesh.zip
Artifact ID: maven-archetype-SiteMesh
Version: 2.3

SpringThis archetype allows you to generate a template for a web application that uses Spring. The sample webapp displays « Hello world! ».

Source: maven-archetype-Spring.zip
Artifact ID: maven-archetype-Spring
Version: 2.5

Spring JPAThis archetype allows you to generate a template for a web application that uses Spring and Hibernate JPA. The sample webapp displays « Hello world! » and allows you to modify a list of people’s names and professions.

The webapp requires a database to be running. The sample uses HSQL.
The sample webapp is capable of running the database by typing: mvn install.
Then, in another window, run the webapp by using the command: mvn jetty:run.
To try the sample webapp, point your browser to http://localhost:8080.

Source: maven-archetype-SpringJpa.zip
Artifact ID: maven-archetype-SpringJpa
Version: spring-2.5, hibernate-3.2.4.sp1
Contributed by: Ermanno Franco, copyright 2006

StrutsThis archetype allows you to generate a template for a web application that uses Struts. The sample webapp allows the user to enter his name to display a customized « Hello » greeting.

Source: maven-archetype-Struts.zip
Artifact ID: maven-archetype-Struts
Version: struts2-2.0.11, struts-taglib-1.3.9

TapestryThis archetype allows you to generate a template for a web application that uses Tapestry. The sample webapp displays « Hello world! » and the current date.
* To view the sample webapp, point your browser to http://localhost:8080/app.

Source: maven-archetype-Tapestry.zip
Artifact ID: maven-archetype-Tapestry
Version: 4.1.3
For version 5.0.5, you can refer to this archetype.

WebWorkThis archetype allows you to generate a template for a web application that uses WebWork. The sample webapp allows the user to enter his name to display a customized « Hello » greeting.

Source: maven-archetype-WebWork.zip
Artifact ID: maven-archetype-WebWork
Version: 2.2.6

WicketThis archetype allows you to generate a template for a web application that uses Wicket. The sample webapp displays its own version of « Hello World! ».

Source: maven-archetype-Wicket.zip
Artifact ID: maven-archetype-Wicket
Version: 1.2.6

Merci à WebTides pour ces fameuses ressources.

4 commentaires On Outils Maven, J2EE, et archetypes

Laisser un commentaire

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.