Clover + Maven + Eclipse,

I am using eclipse + maven2 to build my applications. I need to start working with clover.

So my question is: from your experience, what is the best way to combine these 3.

I mean, I know that there is a clover plugin for eclipse, there is also a clover plugin for maven2 and, of course, there is a maven plugin for eclipse (m2eclipse - which I already use).

What should I use and how?

Thanks.

+3
source share
2 answers

In the Eclipse section, use the Clover Eclipse Plugin .

In Maven, use the Maven Clover Plugin . Add Clover Report to the site creation:

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-clover2-plugin</artifactId>
        <configuration>
          [...]
        </configuration>
        <executions>
          <execution>
            <phase>pre-site</phase>
            <goals>
              <goal>instrument</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
  <reporting>
    <plugins>
      [...]
      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-clover2-plugin</artifactId>
        <configuration>
          [...]
        </configuration>
      </plugin>
    </plugins>
  </reporting>
[...]

:

  <build>
    <plugins>
      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-clover2-plugin</artifactId>
        <configuration>
          <targetPercentage>80%</targetPercentage>
        </configuration>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>instrument</goal>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

maven . , ( m2eclipse).

+5

clover-report maven. clover POMs, . , .

/ maven m2eclipse . 3 . , , clover eclipse, , ( eclipse ) clover maven "" . m2eclipse clover-maven, clover-eclipse, eclipse maven.

+1

Source: https://habr.com/ru/post/1720455/


All Articles