首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jacoco-maven-plugin和maven-surefire-plugin之间的合并

jacoco-maven-plugin和maven-surefire-plugin之间的合并
EN

Stack Overflow用户
提问于 2021-06-30 19:50:58
回答 1查看 658关注 0票数 0

我在使用jacoco-maven-pluginmaven-surefire-plugin时遇到了问题:似乎没有进行覆盖分析!

为了给您提供更多的信息,我使用了jacoco-maven-plugin,它运行良好。不过,我在运行测试时注意到了一个性能问题,并在这里找到了一个解决方案:https://github.com/nats-io/nats-streaming-server/issues/698

我在maven的pom.xml中添加了以下部分:

代码语言:javascript
复制
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <!--
                    Option used to speedup NATS tests (cf. https://github.com/nats-io/nats-streaming-server/issues/698)
                -->
                <configuration>
                    <argLine>-Djava.security.egd=file:/dev/./urandom</argLine>
                </configuration>
            </plugin>

我的性能问题已经解决了,但我意识到,覆盖分析已经不再做了!(当然,我试图恢复我的更改:这个缺陷消失了)

the following page上,我看到这个缺陷已经得到了处理,但是提出的解决方案(从子模块pom移动"maven-surefire-plugin,并且只在父pom的构建部分拥有它“)对我不起作用。

我做了额外的测试。当我的测试运行时,我尝试检查由maven运行的命令行。

这是我得到的:

仅指定jacoco-maven-plugin 时的:

代码语言:javascript
复制
$ ps aux | grep 'urandom\|jacoco'

pmesmeur 1477900 0.0 0.5 9181248 132192 pt/25 Sl+ 21:58 0:02 Sl+test.coverage.while.removing.maven.surefire.plugin/RemoteLpConnector/clientlib/lpconnector_integration/target/jacoco.exec,/media/cersei/ssd/data/home/pmesmeur/Devel/Misys/Projects/SFX/Sandboxes/test.coverage.while.removing.maven.surefire.plugin/RemoteLpConnector/clientlib/lpconnector_integration/target/surefire/surefirebooter2551385423703193145.jar /media/cersei/ssd/data/home/pmesmeur/Devel/Misys/Projects/SFX/Sandboxes/test.coverage.while.removing.maven.surefire.plugin/RemoteLpConnector/clientlib/lpconnector_integration/target/surefire 2021-06-30T21-58-25_026-jvmRun1 surefire7433391136694530406tmp surefire_06093582606115842162tmp

指定jacoco-maven-plugin maven-surefire-plugin 时的:

代码语言:javascript
复制
$ ps aux | grep 'urandom\|jacoco'

pmesmeur 1478702 0.0 2632 772 pts/25 S+ 22:03 0:00 /bin/sh -c cd cd& /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Djava.security.egd=file:/dev/./urandom -jar /media/cersei/ssd/data/home/pmesmeur/Devel/Misys/Projects/SFX/Sandboxes/test.coverage.while.removing.maven.surefire.plugin/RemoteLpConnector/clientlib/lpconnector_integration/target/surefire/surefirebooter4018295361004976187.jar /media/cersei/ssd/data/home/pmesmeur/Devel/Misys/Projects/SFX/Sandboxes/test.coverage.while.removing.maven.surefire.plugin/RemoteLpConnector/clientlib/lpconnector_integration/target/surefire 2021-06-30T22-03-23_413-jvmRun1 1 surefire4924791797502979280tmp surefire_07998612759554882058tmp

我现在完全确定,当maven-surefire-plugin 启用时,没有启动jacoco

如果有人能帮我,我会很感激

向菲利普问好

EN

回答 1

Stack Overflow用户

发布于 2021-07-01 04:34:18

我试图通过maven命令行提供argLine

代码语言:javascript
复制
 -DargLine="-Djava.security.egd=file:/dev/./urandom"

但我也有同样的问题

我在下面的页面上找到了解决问题的解决方案:https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html

-Djava.security.egd=file:/dev/./urandom:

  1. 定义<property>

  1. maven-surefire-plugin org.apache.maven.plugins maven-surefire-plugin

中定义了一个空的<configuration>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68200837

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档