我想将 emma 报告添加到我在 pom 中配置了插件的 maven 项目中:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>1.0-alpha-3</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>
当我运行 mvn clean install
我收到以下错误
[INFO] Compiling 58 source files to target/test-classes
INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] src/test/java/project/testframework/junit/support/SupportInvoker.java:[80,21] cannot access org.springframework.core.env.EnvironmentCapable
class file for org.springframework.core.env.EnvironmentCapable not found
supports.add(ctx.getBean(support));
[ERROR] src/test/java/project/testframework/mockwebcontext/MockWebApplicationContextLoader.java:[37,72] cannot access org.springframework.beans.factory.Aware
class file for org.springframework.beans.factory.Aware not found
final DispatcherServlet dispatcherServlet = new DispatcherServlet() {
[ERROR] src/test/java/project/testframework/mockwebcontext/MockWebApplicationContextLoader.java:[38,24] method does not override or implement a method from a supertype
当我在没有 emma 的情况下运行 mvn clean install 时,一切正常,没有任何错误。我可以使用 eclipse 插件运行 emma,它也可以工作,但我无法从 maven 获得 emma 工作。
有任何想法吗 ??