You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by I am Who i am <ra...@gmail.com> on 2008/10/24 21:51:02 UTC

emma code coverage problem

Hi All,

I'm trying to use emma plugin for my project, after adding the plugin to
pom.xml when i ran emma:emma or any goal i'm getting the following error,
any one had same kinda problem or what iam doing wrong here

Please help me

[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] class [us.state.fw.md.util.LoadLUWCargoMapping] appears to be
instrumented already
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException: class
[us.state.fw.md.util.LoadLUWCargoMapping] appears to be instrumented already
        at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:172)
        at
com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:111)
        at
com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:471)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:193)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
        at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumerate(IPathEnumerator.java:97)
        at
com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:715)
        at com.vladium.emma.Processor.run(Processor.java:54)
        at
org.codehaus.mojo.emma.task.InstrumentTask.execute(InstrumentTask.java:111)
        at
org.codehaus.mojo.emma.EmmaInstrumentMojo.doExecute(EmmaInstrumentMojo.java:155)
        at
org.codehaus.mojo.emma.AbstractEmmaMojo.execute(AbstractEmmaMojo.java:98)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:896)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:739)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:510)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------

Re: emma code coverage problem

Posted by huuf <hu...@hotmail.com>.
And how would you configure a filter if you would like to exclude some
classes from the instrumentation?
-- 
View this message in context: http://maven.40175.n5.nabble.com/emma-code-coverage-problem-tp113505p2651325.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: emma code coverage problem

Posted by Stephen Connolly <st...@gmail.com>.
I'd remove the

     <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>emma-maven-plugin</artifactId>
       <version>1.0-alpha-1</version>
       <inherited>true</inherited>
       <executions>
         <execution>
           <phase>process-classes</phase>
           <goals>
             <goal>instrument</goal>
           </goals>
         </execution>
       </executions>
     </plugin>

as the reporting section will do everything you need.

The instrument goal (afaik) is designed to be invoked to produce a special
build which will produce emma coverage data files when run outside of Maven.

If you did want to record coverage separate from the site (i.e. to fail the
build if coverage < x%), use the emma goal attached after the test phase.
BUT I think you just want it in the reporting section

Can you please file an issue with a link to this thread for us to update the
docs to stop others from falling into the same trap.


2008/10/24 I am Who i am <ra...@gmail.com>

> Thanks for your reply, here it is
>
> <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>us.state</groupId>
>  <artifactId>framework</artifactId>
>  <packaging>jar</packaging>
>  <version>1.0-SNAPSHOT</version>
>  <name>framework</name>
>  <url>http://maven.apache.org</url>
>
>  <build>
>     <sourceDirectory>
>        ejbModule
>     </sourceDirectory>
>
>      <plugins>
>
>    <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-source-plugin</artifactId>
>        <executions>
>        <execution>
>        <phase>package</phase>
>        <configuration>
>            <finalName>framework</finalName>
>        </configuration>
>        <goals>
>        <goal>jar</goal>
>        </goals>
>        </execution>
>        </executions>
>    </plugin>
>
>      <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>emma-maven-plugin</artifactId>
>        <version>1.0-alpha-1</version>
>        <inherited>true</inherited>
>        <executions>
>          <execution>
>            <phase>process-classes</phase>
>            <goals>
>              <goal>instrument</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-surefire-plugin</artifactId>
>        <inherited>true</inherited>
>        <configuration>
>          <forkMode>once</forkMode>
>          <reportFormat>xml</reportFormat>
>
>
> <classesDirectory>${project.build.directory}/generated-classes/emma/classes</classesDirectory>
>
>        </configuration>
>      </plugin>
>
>     </plugins>
>  </build>
>
>  <dependencies>
>  ....
> .....
> ......
>  </dependencies>
>
>  <reporting>
>    <plugins>
>      <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>emma-maven-plugin</artifactId>
>        <version>1.0-alpha-1</version>
>        <inherited>true</inherited>
>      </plugin>
>      <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>surefire-report-maven-plugin</artifactId>
>        <inherited>true</inherited>
>      </plugin>
>    </plugins>
>  </reporting>
>
> </project>
>
>
> On Fri, Oct 24, 2008 at 3:26 PM, Wayne Fay <wa...@gmail.com> wrote:
>
> > Send your emma configuration from your pom.xml file as well, perhaps
> > that may be helpful in figuring things out. You should also consider
> > contacting the emma plugin developers/users list for their help.
> >
> > Wayne
> >
> > On Fri, Oct 24, 2008 at 12:51 PM, I am Who i am <ra...@gmail.com>
> wrote:
> > > Hi All,
> > >
> > > I'm trying to use emma plugin for my project, after adding the plugin
> to
> > > pom.xml when i ran emma:emma or any goal i'm getting the following
> error,
> > > any one had same kinda problem or what iam doing wrong here
> > >
> > > Please help me
> > >
> > > [INFO]
> > >
> ------------------------------------------------------------------------
> > > [ERROR] FATAL ERROR
> > > [INFO]
> > >
> ------------------------------------------------------------------------
> > > [INFO] class [us.state.fw.md.util.LoadLUWCargoMapping] appears to be
> > > instrumented already
> > > [INFO]
> > >
> ------------------------------------------------------------------------
> > > [INFO] Trace
> > > java.lang.IllegalStateException: class
> > > [us.state.fw.md.util.LoadLUWCargoMapping] appears to be instrumented
> > already
> > >        at
> > com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:172)
> > >        at
> > > com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:111)
> > >        at
> > >
> >
> com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:471)
> > >        at
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: emma code coverage problem

Posted by I am Who i am <ra...@gmail.com>.
Thanks for your reply, here it is

<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>us.state</groupId>
  <artifactId>framework</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>framework</name>
  <url>http://maven.apache.org</url>

  <build>
     <sourceDirectory>
        ejbModule
     </sourceDirectory>

      <plugins>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
        <execution>
        <phase>package</phase>
        <configuration>
            <finalName>framework</finalName>
        </configuration>
        <goals>
        <goal>jar</goal>
        </goals>
        </execution>
        </executions>
    </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>emma-maven-plugin</artifactId>
        <version>1.0-alpha-1</version>
        <inherited>true</inherited>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <goals>
              <goal>instrument</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <forkMode>once</forkMode>
          <reportFormat>xml</reportFormat>

<classesDirectory>${project.build.directory}/generated-classes/emma/classes</classesDirectory>

        </configuration>
      </plugin>

     </plugins>
  </build>

  <dependencies>
 ....
.....
......
  </dependencies>

 <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>emma-maven-plugin</artifactId>
        <version>1.0-alpha-1</version>
        <inherited>true</inherited>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>surefire-report-maven-plugin</artifactId>
        <inherited>true</inherited>
      </plugin>
    </plugins>
  </reporting>

</project>


On Fri, Oct 24, 2008 at 3:26 PM, Wayne Fay <wa...@gmail.com> wrote:

> Send your emma configuration from your pom.xml file as well, perhaps
> that may be helpful in figuring things out. You should also consider
> contacting the emma plugin developers/users list for their help.
>
> Wayne
>
> On Fri, Oct 24, 2008 at 12:51 PM, I am Who i am <ra...@gmail.com> wrote:
> > Hi All,
> >
> > I'm trying to use emma plugin for my project, after adding the plugin to
> > pom.xml when i ran emma:emma or any goal i'm getting the following error,
> > any one had same kinda problem or what iam doing wrong here
> >
> > Please help me
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] FATAL ERROR
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] class [us.state.fw.md.util.LoadLUWCargoMapping] appears to be
> > instrumented already
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Trace
> > java.lang.IllegalStateException: class
> > [us.state.fw.md.util.LoadLUWCargoMapping] appears to be instrumented
> already
> >        at
> com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:172)
> >        at
> > com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:111)
> >        at
> >
> com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:471)
> >        at
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: emma code coverage problem

Posted by Wayne Fay <wa...@gmail.com>.
Send your emma configuration from your pom.xml file as well, perhaps
that may be helpful in figuring things out. You should also consider
contacting the emma plugin developers/users list for their help.

Wayne

On Fri, Oct 24, 2008 at 12:51 PM, I am Who i am <ra...@gmail.com> wrote:
> Hi All,
>
> I'm trying to use emma plugin for my project, after adding the plugin to
> pom.xml when i ran emma:emma or any goal i'm getting the following error,
> any one had same kinda problem or what iam doing wrong here
>
> Please help me
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] class [us.state.fw.md.util.LoadLUWCargoMapping] appears to be
> instrumented already
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.IllegalStateException: class
> [us.state.fw.md.util.LoadLUWCargoMapping] appears to be instrumented already
>        at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:172)
>        at
> com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:111)
>        at
> com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:471)
>        at

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org