SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-94

Provide JUnit Listener to record coverage per test

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: JaCoCo
    • Labels:
      None
    • Number of attachments :
      0

      Issue Links

        Activity

        Hide
        Evgeny Mandrikov added a comment -

        For Maven usage of this listener can look like:

        <build>
          ...
          <profiles>
            <profile>
              <id>coverage-per-test</id>
              <dependencies>
                <dependency>
                  <groupId>org.codehaus.sonar-plugins.java</groupId>
                  <artifactId>sonar-jacoco-listeners</artifactId>
                  <version>1.2-SNAPSHOT</version>
                  <scope>test</scope>
                </dependency>
              </dependencies>
              <build>
                <plugins>
                  <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                      <properties>
                        <property>
                          <name>listener</name>
                          <value>org.sonar.java.jacoco.JUnitListener</value>
                        </property>
                      </properties>
                    </configuration>
                  </plugin>
                </plugins>
              </build>
            </profile>
          </profiles>
          ...
        </build>
        
        Show
        Evgeny Mandrikov added a comment - For Maven usage of this listener can look like: <build> ... <profiles> <profile> <id> coverage-per-test </id> <dependencies> <dependency> <groupId> org.codehaus.sonar-plugins.java </groupId> <artifactId> sonar-jacoco-listeners </artifactId> <version> 1.2-SNAPSHOT </version> <scope> test </scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId> org.apache.maven.plugins </groupId> <artifactId> maven-surefire-plugin </artifactId> <configuration> <properties> <property> <name> listener </name> <value> org.sonar.java.jacoco.JUnitListener </value> </property> </properties> </configuration> </plugin> </plugins> </build> </profile> </profiles> ... </build>
        Hide
        Freddy Mallet added a comment -

        Manually tested !

        Show
        Freddy Mallet added a comment - Manually tested !

          People

          • Assignee:
            Evgeny Mandrikov
            Reporter:
            Evgeny Mandrikov
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: