java缺少依赖错误_Jenkin构建Groovy存在错误由于缺少依赖性,无法加载类hudson.model.Hudson...

我是Groovy和Jenkin的初学者 . 我尝试以Freestyle项目开始工作

我添加了 Buid > Add build step > Execute groovy script 并输入这样的代码

#!/usr/bin/env groovy

import hudson.model.*

import hudson.AbortException

import hudson.console.HyperlinkNote

import java.util.concurrent.CancellationException

// Start another job

def job = Hudson.instance.getJob('mhi_job_test2')

def anotherBuild

try {

//def future = job.scheduleBuild()

println "Waiting for the completion of " + job.url + "\nName:"+job.fullDisplayName // HyperlinkNote.encodeTo('/' + job.url, job.fullDisplayName)

//anotherBuild = future.get()

} catch (CancellationException x) {

throw new AbortException("${job.fullDisplayName} aborted.")

}

我尝试通过链接http://localhost:8080/script运行脚本 . 它运作良好

But there are a error Missing dependency

[job_decision] $ D:path-to-groovy-home \ groovy-2.4.7 \ bin \ groovy.bat D:path-to-jenkin \ Jenkins \ workspace \ job_decision \ jenkin.groovy org.codehaus.groovy.control .MultipleCompilationErrorsException:启动失败:类生成期间的常规错误:java.lang.NoClassDefFoundError:由于缺少依赖性而无法加载类hudson.model.Hudson hudson / remoting / VirtualChannel java.lang.RuntimeException:java.lang.NoClassDefFoundError:无法由于缺少依赖性hudson / remoting / VirtualChannel而加载类hudson.model.Hudson

我正在寻找,但没有anwser . 请帮忙

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值