4

我的主要目标是使用 CTL coverage.get 在正在运行的 Web 应用程序上使用 EMMA 获得代码覆盖率。我使用 emma maven 插件。

因此,我使用检测代码部署我的 Web 应用程序。
在tomcat日志中看到:

EMMA: collecting runtime coverage data ...

但没有:

EMMA: runtime controller started on port [47653]

这意味着我无法使用 ctl,因为没有人在听它。
运行时控制器未启动的原因可能是什么?

我的父母 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>

提前致谢。任何提示都非常感谢。

4

1 回答 1

5

尝试这个:

<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>
于 2012-03-27T09:20:50.950 回答