Hi Davis

I'm a bit of a novice with Maven (so the information here might not be the
best way to do things) but I struggled with this same question before giving
up on Emma for the moment and using Cobertura instead.

(BTW I subsquently found this on the Emma site (at
http://emma.sourceforge.net/plugins):
"Maven v2.x is a substantial rewrite of v1.x requiring correspondingly
substantial plugin redesign/rework. There is some interest in creating a
proper Maven v2.x plugin for EMMA. Please get in touch if you would like to
contribute or if you are aware of an independent effort.")

Regarding your question (1), my understanding is that "emma" would be the
actual emma code, whereas "maven-emma-plugin" would be the plugin for maven
to run it. (If I'm wrong about this - anyone - please let me know ...)

In any event here is what I put in my pom.xml to use cobertura (works for me
on Maven 2.0.4):

<project>

  <build>
    [...]
    <plugins>
      [...]
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>clean</id>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    [...]
    <!-- asm, used by cobertura -->
    <dependency>
      <groupId>asm</groupId>
      <artifactId>asm</artifactId>
      <version>2.2.1</version>
      <scope>test</scope>
    </dependency>

    <!-- oro, used by cobertura -->
    <dependency>
      <groupId>oro</groupId>
      <artifactId>oro</artifactId>
      <version>2.0.8</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <reporting>
    [...]
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>

</project>

Then you should be able to run 'mvn cobertura:cobertura' or 'mvn site' and
the cobertura reports will be generated in target/site/cobertura/index.html.

The <executions> section is to bind cobertura to the clean goal since
otherwise the data file generated by cobertura (by default cobertura.ser)
does not get deleted when you run the clean goal (I gather this is a problem
caused by the fact that it's currently not possible to change the output
path of cobertura.ser).

Hope this helps,
Toni

--
View this message in context: 
http://www.nabble.com/Maven-2-Emma-Plugin--t1621781.html#a4394892
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to