Plugin compiler configuré mais ne reconnait pas la version de Java voulue
Bonjour
Comme l'indique le titre, je compile un projet java 6 avec maven mais celui-ci me renvoi les exceptions de compilation suivante :
Citation:
[INFO] Compilation failure
\temp\project\entity\src\main\java\org\test\People.java:[10,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Entity
\temp\project\entity\src\main\java\org\test\Main.java:[40,18] generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)
TypedQuery<People> query =
\temp\project\entity\src\main\java\org\test\Main.java:[43,22] for-each loops are not supported in -source 1.3
(use -source 5 or higher to enable for-each loops)
for (People p : results) {
Ce que j'ai bien entendu fait, c'est de vérifier que mon plugin de compilation avait bien la version désirée :
Code:
1 2 3 4 5 6 7 8 9
| <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin> |
J'ai essayé avec version 2.1, avec source et target à la valeur 6 et la valeur 1.5 mais sans plus de succès.
Voici les pom complets que j'utilise:
D:\temp\project\pom.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.main</groupId>
<artifactId>main-parent</artifactId>
<version>${main.version}</version>
<packaging>pom</packaging>
<name>main-parent</name>
<modules>
<module>maven-config</module>
<module>entity</module>
</modules>
</project> |
D:\temp\project\maven-config
Code:
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 52 53
|
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test</groupId>
<artifactId>maven-config</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>maven-config</name>
<properties>
<!-- declaration des numeros de version-->
<main.version>1.0.0</main.version>
<entity.version>1.0.0</entity.version>
</properties>
<build>
<!-- Rewrite explicite de toute la configuration par defaut des repertoires -->
<directory>build</directory>
<outputDirectory>build/classes</outputDirectory>
<finalName>${artifactId}-${version}</finalName>
<testOutputDirectory>build/test-classes</testOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
<scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<!-- specifie la JDK 6 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project> |
D:\temp\project\entity
Code:
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
|
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.main</groupId>
<artifactId>main-parent</artifactId>
<version>${main.version}</version>
</parent>
<groupId>org.main.entity</groupId>
<artifactId>entity</artifactId>
<version>${main.version}</version>
<name>entity</name>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.0.1.Final</version>
</dependency>
</dependencies>
</project> |
Il doit y avoir sûrement quelque chose qui m'échappe, quelque chose de tout bête.
Désolé si ça fait doublon avec d'autres postes mais malgré avoir cherché... je ne vois pas.
Tchibi