groovy 无法解析类 hudson.scm.SubversionChangeLogSet.LogEntry

Not*_*ica 5 java svn groovy jenkins

我正在尝试使用 Jenkins 上的 groovy 脚本从 SVN 获取更改列表。这就是我正在使用的:

import hudson.model.*
import hudson.util.*
import hudson.scm.*
import hudson.scm.SubversionChangeLogSet.LogEntry

def build = Thread.currentThread()?.executable

def thr = Thread.currentThread()

def envVarsMap = build.parent.builds[0].properties.get("envVars")

// get ChangesSets with all changed items
def changeSet= build.getChangeSet()
List<LogEntry> items = changeSet.getItems()

def affectedFiles = items.collect { it.paths }
def fileNames = affectedFiles.flatten()

new File(envVarsMap["WORKSPACE"],'ChangesSets.txt').withWriter { out ->
fileNames.each {
  out.println it.path
}
}
Run Code Online (Sandbox Code Playgroud)

但是在对 Jankins 运行语法检查时,我收到此错误:

startup failed:
Script1.groovy: 4: unable to resolve class hudson.scm.SubversionChangeLogSet.LogEntry
@ line 4, column 1.
 import hudson.scm.SubversionChangeLogSet.LogEntry
 ^

1 error 
Run Code Online (Sandbox Code Playgroud)

我是 groovy 的新手,任何指示都会非常有帮助。

Groovy 版本:2.3.7
JDK:java 版本“1.7.0_67” Java(TM) SE 运行时环境(构建 1.7.0_67-b01)Java HotSpot(TM) 64 位服务器 VM(构建 24.65-b04,混合模式)

视窗 64 位操作系统

编辑:

我在 subversion-plugin 下找到了这个文件。 https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/java/hudson/scm/SubversionChangeLogSet.java

在 Jenkins 安装中,它位于:C:\Jenkins\plugins\subversion\WEB-INF\lib\classes.jar\hudson\scm\SubversionChangeLogSet.class

基本上在 classes.jar 文件中的 C:\Jenkins\plugins\subversion\WEB-INF\lib 下。

任何指示如何访问它。我想我已经接近解决方案了,但还不够接近。