【问题标题】:jacoco as surefire argLine - The command line is too longjacoco as surefire argLine - 命令行太长
【发布时间】:2017-01-19 22:49:05
【问题描述】:

我正在运行 Jacoco 作为确保成功的代理

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.18.1</version>
    <configuration>
        <argLine>${jacoco.agent.argLine}</argLine>
    </configuration>
</plugin>

我正在为我的 build-breaker 配置 Jacoco,其中包含大量排除项(常量和我已弃用的​​类)。

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.7.5.201505241946</version>
    <configuration>
        <excludes>
            <exclude>*/*Test</exclude>
            <exclude>*/*Constants*</exclude>
            <exclude>${jacoco.exclusions.list}</exclude>
        </excludes>
    </configuration>  

我得到的是,当我去运行测试时,我得到了错误:


 T E S T S
-------------------------------------------------------
The command line is too long.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------  

除了在命令行上的代理参数 arglist 之外,还有其他方法可以将排除列表传递给 Jacoco? (看at the code好像不像)

我的问题是:除了命令行之外,如何将排除列表传递给在 surefire 中运行的 Jacoco 代理?

【问题讨论】:

  • 能否请您详细说明一下 - 为什么您需要一个较长的代理排除列表而不是报告生成?如jacoco.org/jacoco/trunk/doc/agent.html 页所述:“除了性能优化或技术极端情况外,通常不需要此选项。”
  • 这是一个技术极端案例。
  • 您能否详细说明“角落案例”?我问这个问题不是出于好奇,而是作为 JaCoC 开发人员之一,以便了解我们可以做哪些改进。

标签: windows maven jacoco surefire jacoco-maven-plugin


【解决方案1】:

截至今天,JaCoCo Java 代理不允许从文件中读取选项。

但是您可以通过environment variable JAVA_TOOL_OPTIONS 指定代理,它的大小限制应该比命令行更大。

另外JaCoCo in offline mode(无代理)允许通过文件jacoco-agent.properties提供配置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-25
    • 2011-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-28
    相关资源
    最近更新 更多