Bonjour,

J'ai un projet decoupé en module:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
+Artemis-Parent
|   + Pom.xml
+Artemis-JavaModel
|   + Pom.xml
|   + src
|        + main
+Artemis-Java
    + pom.xml
    + src
         +main
         +test
Mes Tests unitaire se trouvent dans Artemis-java. Lorsque j'execute sonar, la couverture de code ne prend en compte que les classes parcourus dans Artemis-Java mais pas dans Artemis-JavaModel.

J'ai essayé d'utiliser la methode décrit ici mais au final Sonar ne reconnait plus aucun TU.

Le pom "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
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
 
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.fdilogbox</groupId>
    <artifactId>artemis</artifactId>
    <packaging>pom</packaging>
    <version>2.1.0-SNAPSHOT</version>
    <name>Artemis Parent</name>
 
    <properties>
         <maven.compile.source>1.6</maven.compile.source>
        <maven.compile.target>1.6</maven.compile.target>
 
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
        <junit.version>4.11</junit.version>
         <!-- Sonar -->
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
        <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
        <sonar.jacoco.reportPath>${project.basedir}/../Artemis-Parent/target/jacoco.exec</sonar.jacoco.reportPath>
        <sonar.surefire.reportsPath>${project.basedir}/../Artemis-Parent/target/junit</sonar.surefire.reportsPath>
    </properties>
 
    <build>
        <pluginManagement>
            <plugins>
                <!-- Use Java 6 VM as a minimum deployment target. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.5.1</version>
                    <configuration>
                        <source>${maven.compile.source}</source>
                        <target>${maven.compile.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <!-- Encode all textual resource files using UTF-8 encoding. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
 
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.13</version>
                    <configuration>
                        <!-- forkMode>once</forkMode-->
                        <aggregate>true</aggregate>
                        <argLine>-Xms512m -Xmx1536m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC</argLine>
                        <testFailureIgnore>true</testFailureIgnore>
                        <failIfNoTests>false</failIfNoTests>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.6.1.201212231917</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>2.0</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>com.*</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <id>pre-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>post-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencyManagement>
        ...
    </dependencyManagement>
 
    <modules>
        <module>../Artemis-JavaModel</module>
        <module>../Artemis-Java</module>
    </modules>
 
</project>
Le pom de artemis-java :
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
<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>com.fdilogbox</groupId>
        <artifactId>artemis</artifactId>
        <version>2.1.0-SNAPSHOT</version>
        <relativePath>../Artemis-Parent</relativePath>
    </parent>
    <artifactId>artemis-java</artifactId>
    <packaging>jar</packaging>
 
    <name>Artemis Java</name>
 
     <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <configuration>
                    <destFile>${project.basedir}/../Artemis-Parent/target/jacoco.exec</destFile>
                    <datafile>${project.basedir}/../Artemis-Parent/target/jacoco.exec</datafile>
                </configuration>
                <executions>
                    <execution>
                        <id>post-test</id>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
 
   <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>artemis-javaModel</artifactId>
            <version>${project.version}</version>
        </dependency>
        ...
    </dependencies>
</project>
Le pom de artemis-javaModel :
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
<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>com.fdilogbox</groupId>
        <artifactId>artemis</artifactId>
        <version>2.1.0-SNAPSHOT</version>
        <relativePath>../Artemis-Parent</relativePath>
    </parent>
    <artifactId>artemis-javaModel</artifactId>
    <packaging>jar</packaging>
 
    <name>Artemis Java Model</name>
 
    <dependencies>
 ...
    </dependencies>
</project>
Je ne vois pas ou pourrait etre mon erreur.
Si vous avez une idée, je suis preuneur. J'utilise Sonar 3.4.1.