Groovy cannot resolve class hudson.scm.SubversionChangeLogSet.LogEntry
I am trying to get a changelog from SVN using a groovy script on Jenkins. This is what I am working with:
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
}
}
But when checking the syntax on Jankins I get this error:
startup failed:
Script1.groovy: 4: unable to resolve class hudson.scm.SubversionChangeLogSet.LogEntry
@ line 4, column 1.
import hudson.scm.SubversionChangeLogSet.LogEntry
^
1 error
I am new to groovy and any pointers would be very helpful.
Groovy version: 2.3.7
JDK: java version "1.7.0_67" Java (TM) SE Runtime Environment (build 1.7.0_67-b01) Java HotSpot (TM) 64-bit Server VM (build 24.65-b04, mixed mode)
Operating system Windows 64 Bit
EDIT:
I found this file in subversion-plugin. https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/java/hudson/scm/SubversionChangeLogSet.java
In a Jenkins installation, this is located at: C: \ Jenkins \ Plugins \ subversive \ WEB-INF \ Lib \ classes.jar \ Hudson \ SCM \ SubversionChangeLogSet.class
Mostly under C: \ Jenkins \ plugins \ subversion \ WEB-INF \ lib in classes.jar file.
Any pointers on how to access this. I think I am close to a solution, but not close enough.
source to share
No one has answered this question yet
Check out similar questions: