【问题标题】:Munit in Jenkins with dependency on Domain projectsJenkins中的Munit依赖于域项目
【发布时间】:2018-08-16 05:09:19
【问题描述】:

我有 Mule 项目“A”,它指的是域项目“X”。我想在 Jenkins 中为项目“A”运行我的 MUnit,但它失败了,因为它无法找到依赖域项目“X”。 为了解决这个问题,我在项目“X” pom.xml 中添加了域项目“A”的“依赖项”。 xml。但没有运气。

请详细说明如何解决将我的 MUnits ion Jenkins 作为构建后操作运行的问题。

谢谢, 伊克拉姆

【问题讨论】:

    标签: maven jenkins mule munit


    【解决方案1】:

    为了能够做到这一点,我必须:

    • 首先,在你的 pom 中添加域依赖,使用“test”范围

      <dependency>
           <groupId>com.mygroupid</groupId>
           <artifactId>mule-domain-id</artifactId>
           <version>1.0.0</version>
           <scope>test</scope>
           <type>zip</type>
      </dependency>
      
    • 其次,您必须将域工件安装在一个工件存储库中(例如 Nexus)。这样,可以从 Jenkins 访问依赖项。然后将该存储库添加到您的 pom.xml

      <repositories>
        <repository>
          <id>alm-nexus</id>
          <name>ALM Nexus Repo</name>
          <url>https://nexus.alm.corp/repository/maven-public</url>
          <layout>default</layout>
        </repository>
      </repositories>
      
    • 在 Jenkins 中运行 MUnit 时的一件重要事情如下。根文件夹名称必须与 artifactId 完全相同,因此在 Jenkins 中,您必须使用自定义设置工作区 如果使用 Jenkinsfile,您可以执行以下操作:

      自定义工作区 "${env.JOB_NAME}/${env.BUILD_ID}/artifact-id-has-to-go-here"

    通过这些步骤,我们能够将 MUnit 测试作为其中一个阶段的工作管道。

    【讨论】:

    • 感谢您的解决方案。我会尝试这种方法
    • 完美,如果这对你有用,请将答案标记为正确。Thx
    • 您好 Ikram,您对提议的解决方案有任何反馈吗?
    猜你喜欢
    • 1970-01-01
    • 2017-09-11
    • 2012-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-07
    • 2020-07-24
    相关资源
    最近更新 更多