【问题标题】:What library does contain basic jenkins workflow groovy functions?哪个库包含基本的 jenkins 工作流 groovy 函数?
【发布时间】:2022-07-07 23:09:09
【问题描述】:

我正在为我的 Jenkins groovy 脚本编写一个 junit 测试。我正在测试的 Jenkins 脚本包含这样的方法调用:

error "Foo"

当我尝试从我的 IDE (Intellij IDEA) 运行测试时,我收到如下错误:

没有方法签名:静态 xxx.error() 适用于参数类型:(org.codehaus.groovy.runtime.GStringImpl) 值 [Foo]

所以我想,我需要在我的类路径中添加一些库,以使运行时知道这个 error 函数。我试过这个maven依赖

        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-aggregator</artifactId>
            <version>2.5</version>
        </dependency>

但它没有帮助。

所以我很难找到包含此处描述的这些基本 Jenkins 工作流函数的库:https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps

有什么想法吗?

【问题讨论】:

    标签: java maven jenkins intellij-idea groovy


    【解决方案1】:

    来源位于here。所以基于pom我会说它在以下依赖中。

    <!-- https://mvnrepository.com/artifact/org.jenkins-ci.plugins.workflow/workflow-basic-steps -->
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-basic-steps</artifactId>
        <version>2.24</version>
        <scope>test</scope>
    </dependency>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多