声纳中的错误 cobertura“初始堆太小”
我正在使用声纳和 cobertura (用于代码覆盖率)。我对我面临的问题感到困惑。如果我运行,
mvn sonar:sonar
我在执行期间看到以下错误,
[INFO]
[INFO] <<< cobertura-maven-plugin:2.5.1:cobertura (default-cli) @ hss-core <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.5.1:cobertura (default-cli) @ hss-core ---
[INFO] Error occurred during initialization of VM
Too small initial heap
[ERROR] Error in Cobertura Report generation: Unable to generate Cobertura Report for project.
org.apache.maven.plugin.MojoExecutionException: Unable to generate Cobertura Report for project.
at org.codehaus.mojo.cobertura.tasks.ReportTask.execute(ReportTask.java:93)
如果我直接使用以下命令运行 cobertura 插件
mvn cobertura:cobertura
,则没有上述错误,并显示以下输出,我认为这是预期的输出。
[INFO]
[INFO] <<< cobertura-maven-plugin:2.5.1:cobertura (default-cli) @ hss-core <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.5.1:cobertura (default-cli) @ hss-core ---
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Cobertura: Loaded information on 39 classes.
Report time: 1035ms
我已经设置了 MAVEN_OPTS (MAVEN_OPTS=-Xms512m) 环境变量,但仍然收到错误。
谁能告诉我出了什么问题以及如何解决这个问题?
I'm using sonar and cobertura (for code coverage). I'm baffled with the problem I'm facing. If I run
mvn sonar:sonar
I saw the following error during executions
[INFO]
[INFO] <<< cobertura-maven-plugin:2.5.1:cobertura (default-cli) @ hss-core <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.5.1:cobertura (default-cli) @ hss-core ---
[INFO] Error occurred during initialization of VM
Too small initial heap
[ERROR] Error in Cobertura Report generation: Unable to generate Cobertura Report for project.
org.apache.maven.plugin.MojoExecutionException: Unable to generate Cobertura Report for project.
at org.codehaus.mojo.cobertura.tasks.ReportTask.execute(ReportTask.java:93)
if I run the cobertura plugin directly using the following
mvn cobertura:cobertura
There is no error as above, and display the following output, which I assume was the expected output.
[INFO]
[INFO] <<< cobertura-maven-plugin:2.5.1:cobertura (default-cli) @ hss-core <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.5.1:cobertura (default-cli) @ hss-core ---
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Cobertura: Loaded information on 39 classes.
Report time: 1035ms
I have set the MAVEN_OPTS (MAVEN_OPTS=-Xms512m) environment variable, but still getting the error.
Can anyone tell me what went wrong, and how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几乎感觉您在 -Xms 参数中省略了“m”:
检查其他环境变量的值以查看是否定义了任何与 Java 相关的内容(Windows 上的“set”命令应该将它们全部打印出来)不会有什么坏处 - 检查_JAVA_OPTS、MAVEN_OPTS 等。
It almost feel that you omitted 'm' in your -Xms parameter:
Won't hurt to check values for other environment variables to see if there is anything Java-related defined ('set' command on Windows should print them all) - check _JAVA_OPTS, MAVEN_OPTS etc.
Sonar Cobertura 插件有一个特定参数来增加分配给 Cobertura 进程的内存:sonar.cobertura.maxmem
例如,您可以运行: mvn sonar:sonar -Dsonar.cobertura.maxmem=512m
请参阅 http://docs.codehaus.org/display/SONAR/Code+coverage+plugins#Cobertura
Sonar Cobertura Plugin had a specific parameter to increase the memory allocated to the Cobertura process: sonar.cobertura.maxmem
For instance, you can run: mvn sonar:sonar -Dsonar.cobertura.maxmem=512m
See http://docs.codehaus.org/display/SONAR/Code+coverage+plugins#Cobertura