【问题标题】:license issue in mule when building with junit test cases使用junit测试用例构建时mule中的许可证问题
【发布时间】:2017-03-17 23:57:59
【问题描述】:

请帮我解决这个问题。

当我通过跳过Junit 测试用例来构建mule maven 项目时。构建是成功的。但是,当我使用 Juint 测试用例构建相同的项目时,构建失败并显示以下错误消息:

Caused by: com.mulesource.licm.impl.InvalidLicenseKeyException: de.schlichtherle.license.NoLicenseInstalledException: 

There is no license certificate installed for MuleSource Enterprise Edition.
at com.mulesource.licm.impl.TrueLicenseHelper.validateLicenseKey(TrueLicenseHelper.java:233).

我只是在构建。请告诉我我必须做些什么来克服这个问题。如果我在运行的 mule 中运行 Junit 测试用例。当我将其转换为 maven 项目并开始构建时,我将面临上述问题

【问题讨论】:

    标签: maven junit mule


    【解决方案1】:

    如果您使用 Enterprise 功能,则需要类路径中的有效许可证 (muleLicenseKey.lic) 才能使用 Maven 运行测试。

    【讨论】:

    • 我在 src/test/resources 中添加了 .lic 文件。仍然显示相同的错误。我需要添加任何配置来在 pom.xml 中选择 licence.lic 吗?
    • 您需要从 license.lic 生成的 muleLicenseKey.lic 文件。 mulesoft.org/documentation/display/current/…
    【解决方案2】:

    要在 Studio 之外运行测试,您应该将 muleLicense.lic 从您的 conf 文件夹复制到您的类路径(即 src/test/resources)

    【讨论】:

    • 我在 src/test/resources 中添加了 .lic 文件。仍然显示相同的错误。我需要添加任何配置来在 pom.xml 中选择 licence.lic 吗?
    • 我可以确认将 muleLicense.lic 添加到 src/test/resources 目录确实可以通过 Maven 命令行运行 Mule 测试。仅供参考,您可能必须将 xalan.jar 添加到测试范围 - 我认为 Mule Studio 在其自己的运行时环境中提供了合适的 XPathAPI 源。
    【解决方案3】:

    从 Mule 版本 3.5.2 开始,在 Maven 下运行的单元测试不再需要许可证文件。

    向 Maven 命令添加系统属性参数:

    mvn clean test -Dmule.testingMode=true
    

    这将在不需要许可证文件的情况下运行测试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-06
      • 1970-01-01
      • 2017-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多