Bonjour à tous,
Le problème est peut-être trivial mais je commence à manquer d'idées.
J'ai une application web en Java qui tourne avec Maven.
La compilation des sources (mvn compile) fonctionne parfaitement mais lorsqu'il s'agit de faire de même avec les tests (mvn test ou mvn test-compile), le compilateur semble perdu (et moi aussi).
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
|
>mvn clean test-compile
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building dkproject web application
[INFO] task-segment: [clean, test-compile]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting file set: C:\projects\dkproject\target (included: [**], excluded: [])
[INFO] [apt:execute {execution: default}]
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[INFO] [resources:resources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] Copying 0 resource
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] [compiler:testCompile]
[INFO] Compiling 17 source files to C:\projects\dkproject\target\test-classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
Failure executing javac, but could not parse the error:
The system cannot find the path specified.
Failure executing javac, but could not parse the error:
The system cannot find the path specified.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Fri Jul 23 11:38:34 CEST 2010
[INFO] Final Memory: 15M/37M
[INFO] ------------------------------------------------------------------------ |
La structure du projet respecte pourtant celle préconisée par Maven:
|-- src
| |-- main
| | |-- java
| | |-- resources
| | |-- webapp
| |-- test
| | |-- java
| | |-- resources
|-- target
|-- pom.xml
Quant au POM.xml, en voici un extrait qui contient des informations sur le compilateur :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<build>
<finalName>dkproject-web</finalName>
<plugins>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build> |
A noter qu'un "Clean + Build automatically" sous Eclipse compile les classes de tests et qu'un 'mvn test' en lignes de commande fonctionne très bien par la suite (ce qui était prévisible):
[INFO] Nothing to compile - all classes are up to date
Questions: pourquoi le compilateur n'arrive pas à compiler mes classes sous \target\test-classes?
The system cannot find the path specified.
De quel chemin parle-t-il ? S'il s'agit de celui des classes Java de test, elles sont sous \test\java\com\... S'il s'agit du compilateur java, il est dans la variable JAVA_HOME (et ça compile très bien les sources).
Merci par avance
Romm
Partager