Bonjour,
Je suis novice dans l'utilisation de maven et de ant alors je demande votre aide.
Voilà, j'ai un build.xml ant qui fonctionne très bien. Celui ci me génère des classes Java à l'aide d'hibernate.
Seulement, je n'arrive pas à appeler correctement ce script depuis mavenJe suis sûr que c'est un truc tout bête, mais là je sèche.
Mon build.xml :
Mon code dans le maven.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 <project name="testcase" default="run"> <path id="toolslib"> <path location="./lib/hibernate-tools.jar" /> <path location="./lib/commons-collections-2.1.1.jar" /> <path location="./lib/hibernate3.jar" /> <path location="./lib/cglib-2.1.3.jar" /> <path location="./lib/dom4j-1.6.jar" /> <path location="./lib/commons-logging-1.0.4.jar" /> <path location="./lib/freemarker.jar" /> <path location="./lib/postgresql-8.1-404.jdbc3.jar" /> <path location="./lib/ojdbc14.jar" /> <path path="." /> <path path="./bin" /> </path> <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" /> <hibernatetool destdir="D:/workspace ref/projet/src/main/java"> <configuration configurationfile="hibernate.cfg.xml"> <fileset dir="D:/workspace ref/projet/src/main/resources"> <include name="**/*.hbm.xml" /> </fileset> </configuration> <hbmtemplate template="templates/projet/Pojo.ftl" filepattern="{package-name}/{class-name}.java"> <property key="jdk5" value="true" /> <property key="ejb3" value="false" /> </hbmtemplate> </hibernatetool> <hibernatetool destdir="D:/workspace ref/projet/src/main/resources"> <configuration configurationfile="hibernate.cfg.xml"> <fileset dir="D:/workspace ref/projet/src/main/resources"> <include name="**/*.hbm.xml" /> </fileset> </configuration> <hbm2ddl export="false" outputfilename="schema.ddl" format="true" /> </hibernatetool> </project>
Le message d'erreur que j'obtiens maintenant est "Unexpected element 'hibernatetool'"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <goal name="creerVO"> <ant:ant antfile="./build.xml"/> </goal>![]()
J'ai aussi essayé de tout mettre dans le maven.xml mais là, j'avais des problèmes de classe PropertySet. Je l'ai téléchargé dans ma repository maven mais sans succès.
Si quelqu'un a la solution, je suis preneur.
Et aussi, vous avez le droit de vous moquer![]()
Partager