【问题标题】:Passing arguments to dependency eclipse plugins when using mvn-tycho使用 mvn-tycho 时将参数传递给依赖 eclipse 插件
【发布时间】:2017-04-12 10:21:00
【问题描述】:

我正在尝试为 Eclipse 插件编写单元测试用例。通过http://www.vogella.com/tutorials/EclipseTycho/article.html#run-the-build-with-the-tests 并创建了一个eclipse-test-plugin。

因此,测试插件(我们称之为 plugin-b)依赖于另一个为其编写测试的插件(plugin-a)。 当我运行 mvn clean install 时,我可以看到 tycho-surefire 正在尝试运行测试,并且在此过程中正在尝试启动 plugin-a。但是,plugin-a 需要一组 VM 参数才能正确启动。我试图传递如下参数: mvn -Dabc.properties=bridge\bundles\com.blah.blah.blah.blah.bridge\abc.properties 全新安装

但他们没有通过插件-a。

非常感谢任何帮助。

【问题讨论】:

    标签: java eclipse maven tycho tycho-surefire-plugin


    【解决方案1】:

    终于想通了:

    mvn clean install -Dtycho.testArgLine="-Dabc.properties=../../bundles/com.blah.blah.blah.blah.bridge/abc.properties"

    这会将系统属性传递给测试运行时。

    【讨论】:

    • 这是从命令行(使用-D)为分叉的测试虚拟机设置系统属性时使用的正确选项。但是,您也可以将系统属性直接保存在 POM 中;只需将<systemProperties> element 添加到tycho-surefire-plugin<configuration>
    猜你喜欢
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 2017-05-04
    • 1970-01-01
    • 1970-01-01
    • 2013-02-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多