使用 EMMA 编译失败
我想将 emma 报告添加到 Maven 项目中,我已经在 pom 中配置了插件:
<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 工作。
有什么想法吗?
I want to add emma reports into the maven project I have configured the plugin in pom :
<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>
and when I run
mvn clean install
I get following error
[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
When I run mvn clean install without emma everything works without any errors.
I can run emma using eclipse plugin and it works as well but I can't get emma work from maven.
Any Ideas ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论