mardi 19 octobre 2010

maven : les archetypes interessants

un super lien sur maven et les archetypes notables

Voici un petit résumé des archetypes les plus utiles :


* maven-archetype-quickstart (un simple jar)

* maven-archetype-webapp (une simple webapp)

* maven-archetype-mojo (un plugin maven)



En résumé AppFuse, c'est Spring / hibernate / (JSF, struts ou tapestry)) et MySQL le quickstart AppFuse est nécessaire

* appfuse-basic-jsf et appfuse-modular-jsf
Application complète utilisant JSF (Java Server Faces) comme couche de présentation.

* appfuse-basic-spring et appfuse-modular-spring
Application complète utilisant Spring MVC comme couche de présentation.

* appfuse-basic-struts et appfuse-modular-struts
Application complète utilisant Struts 2 comme couche de présentation.

* appfuse-basic-tapestry et appfuse-modular-tapestry
Application complète utilisant Tapestry comme couche de présentation.

* appfuse-core (Modèle objet et sa couche de persistance sans couche présentation.)


Voici un petit exemple :


mvn archetype:generate \
-DarchetypeArtifactId=appfuse-modular-spring \
-DarchetypeGroupId=org.appfuse.archetypes \
-DgroupId=org.sonatype.mavenbook \
-DartifactId=mod-spring \
-Dversion=1.0-SNAPSHOT \
-DinteractiveMode=false

Ou avec Tapestry :
mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-tapestry-archetype -DarchetypeVersion=2.1.0-M1 -DgroupId=com.mycompany -DartifactId=myproject



Rappel pour MySQL et AppFuse

Il faut un "user mySQL" root avec un password vide

MySQL Security
Running MySQL using root with no password is not the most secure thing to do. Once your database is created, you can change the root password using the command below:
mysql --user=root --pass='' mysql -e "update user set password=password('newpw') \
where user='root'; flush privileges;"
AppFuse uses the username "root" and a blank password by default. To change these values, modify the and properties in your project's pom.xml (at the bottom).

Aucun commentaire:

Enregistrer un commentaire