Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docpublic:concepts:java:maven [2014/12/20 22:08]
procacci@tem-tsp.eu
docpublic:concepts:java:maven [2016/04/26 13:15] (current)
procacci@tem-tsp.eu [reprise sous debien generate]
Line 8: Line 8:
  
 TP  http://dcabasson.developpez.com/articles/java/maven/introduction-maven2/ TP  http://dcabasson.developpez.com/articles/java/maven/introduction-maven2/
 +
 +==== 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 54: Line 56:
 [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------
 </code> </code>
 +
 +==== reprise sous debian generate ====
 +
 +apres execution de ce create sous centos, une reprise de l'arborescence sous debian donne ceci au "create" 
 +
 +<code>
 +$ mvn -e archetype:create -DgroupId=com.javaworld.hotels -DartifactId=HotelDatabase -Dpackagename=com.javaworld.hotels
 ++ Error stacktraces are turned on.
 +[INFO] Scanning for projects...
 +[INFO] Reactor build order: 
 +[INFO]   Hotel Database tutorial application
 +[INFO]   Hotel webapp tutorial application
 +[INFO]   Unnamed - com.javaworld.hotels:Hotel:pom:1.0-SNAPSHOT
 +[INFO] Searching repository for plugin with prefix: 'archetype'.
 +[INFO] ------------------------------------------------------------------------
 +[INFO] Building Unnamed - com.javaworld.hotels:Hotel:pom:1.0-SNAPSHOT
 +[INFO]    task-segment: [archetype:create] (aggregator-style)
 +[INFO] ------------------------------------------------------------------------
 +[INFO] ------------------------------------------------------------------------
 +[ERROR] BUILD ERROR
 +[INFO] ------------------------------------------------------------------------
 +[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-archetype-plugin:2.4
 +...
 +Cause: Cannot assign configuration entry 'pomRemoteRepositories' to 'interface java.util.List' from 'null', which is of type class java.lang.String
 +[INFO] ------------------------------------------------------------------------
 +[INFO] Trace
 +org.apache.maven.lifecycle.LifecycleExecutionException: Error configuring: org.apache.maven.plugins:maven-archetype-plugin. Reason: Unable to parse the created DOM for plugin configuration
 +</code>
 +
 +solution : faire un generate plutot qu'un create qui est devenu deprecated en maven 3 
 +
 +http://stackoverflow.com/questions/29147329/unable-to-create-a-new-maven-hello-world-project
 +
 +esuite si pb de ce type
 +
 +<code>
 +$ mvn -e archetype:generate -DgroupId=com.javaworld.hotels -DartifactId=HotelDatabase -Dpackagename=com.javaworld.hotels 
 +....
 +[ERROR] BUILD FAILURE
 +[INFO] ------------------------------------------------------------------------
 +[INFO] : org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: Directory HotelDatabase already exists - please run from a clean directory
 +Directory HotelDatabase already exists - please run from a clean directory
 +[INFO] ------------------------------------------------------------------------
 +[INFO] Trace
 +org.apache.maven.BuildFailureException: Directory HotelDatabase already exists - please run from a clean directory
 +
 +</code>
 +
 +c'est qu'on est pas dans le bon niveau d'arborescence
 +il faut remonter d'un cran 
 +
 +<code>
 +$ cd ..
 +$ ls
 +application  application.tgz
 +$ mvn archetype:generate -DgroupId=com.javaworld.hotels -DartifactId=HotelDatabase -Dpackagename=com.javaworld.hotels
 +[INFO] Scanning for projects...
 +[INFO] Searching repository for plugin with prefix: 'archetype'.
 +...
 +[INFO] project created from Old (1.x) Archetype in dir: /home/xib/HotelDatabase
 +[INFO] ------------------------------------------------------------------------
 +[INFO] BUILD SUCCESSFUL
 +</code>
 +
 +==== clean ====
 +
 +<code>
 +$ mvn clean
 +[INFO] Scanning for projects...
 +[INFO] Reactor build order: 
 +[INFO]   Hotel Database tutorial application
 +[INFO]   Hotel webapp tutorial application
 +[INFO]   Unnamed - com.javaworld.hotels:Hotel:pom:1.0-SNAPSHOT
 +[INFO] ------------------------------------------------------------------------
 +[INFO] Building Hotel Database tutorial application
 +[INFO]    task-segment: [clean]
 +[INFO] ------------------------------------------------------------------------
 +Downloading: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
 +3K downloaded  (maven-clean-plugin-2.5.pom)
 +</code>
 +
  
 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.
docpublic/concepts/java/maven.1419113335.txt.gz · Last modified: 2014/12/20 22:08 by procacci@tem-tsp.eu
[unknown link type]Back to top
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0