This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docpublic:concepts:java:maven [2014/12/20 21:53] procacci@tem-tsp.eu [ref] |
docpublic:concepts:java:maven [2016/04/26 13:15] (current) procacci@tem-tsp.eu [reprise sous debien generate] |
||
---|---|---|---|
Line 5: | Line 5: | ||
* http:// | * http:// | ||
* http:// | * http:// | ||
+ | * http:// | ||
TP http:// | TP http:// | ||
+ | |||
+ | ==== create ==== | ||
9. Création d'un nouveau projet avec le plug-in archetype | 9. Création d'un nouveau projet avec le plug-in archetype | ||
Line 53: | Line 56: | ||
[INFO] ------------------------------------------------------------------------ | [INFO] ------------------------------------------------------------------------ | ||
</ | </ | ||
+ | |||
+ | ==== reprise sous debian generate ==== | ||
+ | |||
+ | apres execution de ce create sous centos, une reprise de l' | ||
+ | |||
+ | < | ||
+ | $ mvn -e archetype: | ||
+ | + Error stacktraces are turned on. | ||
+ | [INFO] Scanning for projects... | ||
+ | [INFO] Reactor build order: | ||
+ | [INFO] | ||
+ | [INFO] | ||
+ | [INFO] | ||
+ | [INFO] Searching repository for plugin with prefix: ' | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [INFO] Building Unnamed - com.javaworld.hotels: | ||
+ | [INFO] | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [ERROR] BUILD ERROR | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [INFO] Failed to configure plugin parameters for: org.apache.maven.plugins: | ||
+ | ... | ||
+ | Cause: Cannot assign configuration entry ' | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [INFO] Trace | ||
+ | org.apache.maven.lifecycle.LifecycleExecutionException: | ||
+ | </ | ||
+ | |||
+ | solution : faire un generate plutot qu'un create qui est devenu deprecated en maven 3 | ||
+ | |||
+ | http:// | ||
+ | |||
+ | esuite si pb de ce type | ||
+ | |||
+ | < | ||
+ | $ mvn -e archetype: | ||
+ | .... | ||
+ | [ERROR] BUILD FAILURE | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [INFO] : org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: | ||
+ | Directory HotelDatabase already exists - please run from a clean directory | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [INFO] Trace | ||
+ | org.apache.maven.BuildFailureException: | ||
+ | |||
+ | </ | ||
+ | |||
+ | c'est qu'on est pas dans le bon niveau d' | ||
+ | il faut remonter d'un cran | ||
+ | |||
+ | < | ||
+ | $ cd .. | ||
+ | $ ls | ||
+ | application | ||
+ | $ mvn archetype: | ||
+ | [INFO] Scanning for projects... | ||
+ | [INFO] Searching repository for plugin with prefix: ' | ||
+ | ... | ||
+ | [INFO] project created from Old (1.x) Archetype in dir: / | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [INFO] BUILD SUCCESSFUL | ||
+ | </ | ||
+ | |||
+ | ==== clean ==== | ||
+ | |||
+ | < | ||
+ | $ mvn clean | ||
+ | [INFO] Scanning for projects... | ||
+ | [INFO] Reactor build order: | ||
+ | [INFO] | ||
+ | [INFO] | ||
+ | [INFO] | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | [INFO] Building Hotel Database tutorial application | ||
+ | [INFO] | ||
+ | [INFO] ------------------------------------------------------------------------ | ||
+ | Downloading: | ||
+ | 3K downloaded | ||
+ | </ | ||
+ | |||
Vous avez maintenant une structure de projet Maven 2 toute neuve. Allez dans le répertoire HotelDatabase pour continuer ce tutoriel. | Vous avez maintenant une structure de projet Maven 2 toute neuve. Allez dans le répertoire HotelDatabase pour continuer ce tutoriel. | ||
Line 367: | Line 451: | ||
[INFO] Final Memory: 8M/20M | [INFO] Final Memory: 8M/20M | ||
[INFO] ------------------------------------------------------------------------ | [INFO] ------------------------------------------------------------------------ | ||
+ | </ | ||
+ | |||
+ | |||
+ | contenu du war | ||
+ | |||
+ | < | ||
+ | [disi@cas4 HotelWebapp]$ jar tvf ./ | ||
+ | 0 Sat Dec 20 22:44:04 CET 2014 META-INF/ | ||
+ | 123 Sat Dec 20 22:44:02 CET 2014 META-INF/ | ||
+ | 0 Sat Dec 20 22:44:02 CET 2014 WEB-INF/ | ||
+ | 0 Sat Dec 20 22:44:02 CET 2014 WEB-INF/ | ||
+ | 0 Sat Dec 20 22:44:02 CET 2014 WEB-INF/ | ||
+ | 215 Sat Dec 20 22:37:44 CET 2014 WEB-INF/ | ||
+ | 4153 Tue Dec 16 18:04:22 CET 2014 WEB-INF/ | ||
+ | 1571 Sat Dec 20 22:41:22 CET 2014 index.jsp | ||
+ | 0 Sat Dec 20 22:44:04 CET 2014 META-INF/ | ||
+ | 0 Sat Dec 20 22:44:04 CET 2014 META-INF/ | ||
+ | 0 Sat Dec 20 22:44:04 CET 2014 META-INF/ | ||
+ | 892 Sat Dec 20 22:43:54 CET 2014 META-INF/ | ||
+ | 123 Sat Dec 20 22:44:02 CET 2014 META-INF/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | deployement dynamique du war dans tomcat | ||
+ | |||
+ | < | ||
+ | [root@cas4 ~]# ls -l / | ||
+ | total 0 | ||
+ | drwxr-xr-x 5 root tomcat 82 10 déc. 16:25 host-manager | ||
+ | drwxr-xr-x 5 root tomcat 97 10 déc. 16:25 manager | ||
+ | [root@cas4 ~]# cp / | ||
+ | [root@cas4 ~]# ls -l / | ||
+ | total 8 | ||
+ | drwxr-xr-x 5 root | ||
+ | drwxr-xr-x 4 tomcat tomcat | ||
+ | -rw-r--r-- 1 root | ||
+ | drwxr-xr-x 5 root | ||
+ | |||
+ | </ | ||
+ | |||
+ | log tomcat au meme moment | ||
+ | |||
+ | < | ||
+ | [root@cas4 ~]# tail -f / | ||
+ | |||
+ | déc. 20, 2014 11:06:01 PM org.apache.catalina.startup.HostConfig deployWAR | ||
+ | INFOS: Déploiement de l' | ||
+ | |||
+ | </ | ||
+ | |||
+ | http:// | ||
+ | |||
+ | < | ||
+ | Application Tutoriel pour la base de données des hotels | ||
+ | |||
+ | Choisissez une destination | ||
+ | |||
+ | Merci de choisir une ville :  Chercher | ||
+ | Hôtels disponibles à Londres | ||
+ | |||
+ | Nom Adresse Ville Catégorie | ||
+ | Hotel Hilton Trafalgar Square Londres 4 étoiles | ||
+ | Hotel Ibis The City Londres 3 étoiles | ||
</ | </ | ||