Bonjour,

J'ai un problème serieux depuis plusieurs jours, je tente de lancer une class via le plugin ant pour maven 2. Extrait de mon pom :
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
41
42
43
44
45
46
47
48
49
50
51
 
<plugin>
   <artifactId>maven-antrun-plugin</artifactId>
 
<!-- Add the Ant plugin tools -->
   <dependencies>
      <dependency>
         <groupId>ant</groupId>
 
         <artifactId>ant</artifactId>
 
         <version>1.6.5</version>
      </dependency>
   </dependencies>
 
   <executions>
      <execution>
         <id>DependencyFinder</id>
 
         <phase>process-sources</phase>
 
         <configuration>
            <tasks>
               <property name="dependencyfinder.home" value="P:\DependencyFinder" />
 
               <property name="apacheant.home" value="P:\maven_repository\ant\ant\1.6.5" />
 
               <path id="dependencyfinder">
                  <pathelement location="${dependencyfinder.home}/classes" />
 
                  <pathelement location="${dependencyfinder.home}/lib/DependencyFinder.jar" />
 
                  <pathelement location="${dependencyfinder.home}/lib/jakarta-oro.jar" />
 
                  <pathelement location="${dependencyfinder.home}/lib/log4j.jar" />
 
                  <pathelement location="${apacheant.home}/ant-1.6.5.jar" />
               </path>
 
               <taskdef name="classmetrics" classname="com.jeantessier.dependencyfinder.ant.ClassMetrics">
                  <classpath refid="dependencyfinder" />
               </taskdef>
            </tasks>
         </configuration>
 
         <goals>
            <goal>run</goal>
         </goals>
      </execution>
   </executions>
</plugin>
et pas moyen de me débarasser du problème :
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: taskdef A class needed by class com.jeantessier.dependencyfinder
.ant.ClassMetrics cannot be found: org/apache/tools/ant/Task
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error executing ant task

Pourtant lorsque j'essaye sur mon poste chez moi cela fonctionne à merveille.
Est-ce que quelqu'un à une idée, j'ai testé pas mal de chose :
- Mise du ant-1.6.5.jar dans la variable d'environnement CLASSPATH,
- Mise en dependencies de la librairies ant
- Mise dans le classpath du taskdef
....