4

My primary goal is to get code coverage using EMMA on a running web application using CTL coverage.get. I use emma maven plugin.

So, I deploy my web application with instrumented code.
In tomcat log is see:

EMMA: collecting runtime coverage data ...

but there is no:

EMMA: runtime controller started on port [47653]

Which means that Im not able to use ctl as nobody is listening for it.
What could be the reason of runtime controller not starting?

My parent pom.xml:

<project>
        ...
         <build>
            <plugins>
                ...
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                        <artifactId>emma-maven-plugin</artifactId>
                        <inherited>true</inherited>   
                        <executions>
                            <execution>
                                <id>instrument</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>instrument</goal>
                                </goals>
                            </execution>                            
                        </executions>
                </plugin>
                ...
            </plugins>
        </build>
        ... 
        <reporting>
            <plugins>        
                ...
                <plugin>      
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>emma-maven-plugin</artifactId>
                    <version>1.0-alpha-3</version>
                    <inherited>true</inherited>      
                </plugin>
                ...
            </plugins>
        </reporting>
        ...
    </project>

Thanks in advance. Any hint is highly appreciated.

ilu
  • 133
  • 2
  • 7

1 Answers1

5

Try this:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.10</version>
    <configuration>
         <systemPropertyVariables combine.children="append">
             <emma.rt.control>true|false</emma.rt.control>
         </systemPropertyVariables>
    </configuration>
</plugin>
Stewart
  • 17,616
  • 8
  • 52
  • 80
  • 4
    Thanks Stewart. This helped me out. I found you can also just add `-Demma.rt.control=false` to the mvn command. For instance `mvn emma:emma -Demma.rt.control=false` – Kyle Jul 06 '12 at 13:26