• IDEA 运行单元测试报错 @{argLine}


    sentinel是今年阿里开源的高可用防护的流量管理框架

    git地址:https://github.com/alibaba/Sentinel

    wiki:https://github.com/alibaba/Sentinel/wiki

    FAQ:https://github.com/alibaba/Sentinel/wiki/FAQ

    --------------------------------------------------------------------------------------------------------------------------------------------------------

    工程里有很多单元测试,在IDEA里运行时报错:

    ����: �Ҳ������޷��������� @{argLine}

    错误信息有乱码,VM参数加上-Dfile.encoding=UTF-8,再次运行:

    错误: 找不到或无法加载主类 @{argLine}

    解决方法:File->Settings->Build,Execution,Deployment->Build Tools->Maven->Running Tests 去掉argLine的勾选

    --------------------------------------------------------------------------------------------------------------------------------------------------------

    ctrl+shift+F全局搜索@{argLine},发现在sentinel-parent父工程的pom.xml里,使用了一个maven插件

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
            <!-- CircleCI build workaround -->
            <argLine>@{argLine} -Xms1024m -Xmx2048m</argLine>         
            <useSystemClassLoader>false</useSystemClassLoader>
        </configuration>
    </plugin>

    参考maven官方文档:http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#late-property-evaluation

    allows late replacement of properties when the plugin is executed, so properties that have been modified by other plugins will be picked up correctly.

    该占位符能让后面的插件在执行时正确的替换属性。

    sentinel官方团队也在钉钉群给了说明:

    这是 CI 生成测试覆盖率报告的时候自动装填用的,本地可以去掉。

  • 相关阅读:
    word2vec原理
    tensorboard
    更换pip源到国内镜像
    pycharm打包exe
    whl文件下载
    pycharm连git和gitee
    Django基础
    mysql相关
    安装anaconda及pytorch
    VSCode 配置python
  • 原文地址:https://www.cnblogs.com/cdfive2018/p/10167188.html
Copyright © 2020-2023  润新知