Bonjour,
je viens de passer un projet sous maven 3 et j'ai pas mal de petit problème. Alors que sous maven 2 aucun. J'ai essayer de reproduire le même type de problème et en voilà un exemple.
voilà le fichier pom.xml (chemin /):
le fichier pom.xml (chemin /parent):
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 <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>fr.test</groupId> <artifactId>parent</artifactId> <version>0.0.1-SNAPSHOT</version> <relativePath>parent/pom.xml</relativePath> </parent> <groupId>fr.test</groupId> <artifactId>reactor</artifactId> <packaging>pom</packaging> <name>test-reactor</name> <modules> <module>parent</module> <module>common</module> </modules> </project>
le fichier pom.xml (chemin /common):
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 <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>fr.test</groupId> <artifactId>parent</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <name>test-parent</name> <properties> <compile.source>1.5</compile.source> <compile.target>1.5</compile.target> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <scope>test</scope> <type>jar</type> </dependency> <dependency> <groupId>fr.test.common</groupId> <artifactId>exception</artifactId> <type>jar</type> <version>${project.version}</version> </dependency> </dependencies> </dependencyManagement> <build> </build> </project>
et le dernier fichier pom.xml (chemin /common/exception):
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 <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>fr.test</groupId> <artifactId>parent</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <groupId>fr.test.common</groupId> <artifactId>common</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <name>test-common</name> <modules> <module>exception</module> </modules> </project>
dès que je lance une compilation un maven 3 j'ai le message d'erreur:
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 <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>fr.test.common</groupId> <artifactId>common</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <groupId>fr.test.common</groupId> <artifactId>exception</artifactId> <name>test-common-exception</name> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> </dependency> </dependencies> </project>
Pourtant je spécifie bien le fichier chemin vers le pom.xml parent dans le réactor. D'ou peut venir l'erreur ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 [ERROR]*The*build*could*not*read*1*project*->*[Help*1] [ERROR] [ERROR]***The*project*fr.test.common:common:0.0.1-SNAPSHOT*(C:\Users\Damien\work space\reactor\common\pom.xml)*has*1*error [ERROR]*****Non-resolvable*parent*POM:*Could*not*find*artifact*fr.test:parent:po m:0.0.1-SNAPSHOT*and*'parent.relativePath'*points*at*wrong*local*POM*@*line*5,*c olumn*10*->*[Help*2]
Partager