rather than use the SVN CLI and parse output - there's a java library for interacting with SVN.
@Grab(group='org.tmatesoft.svnkit', module='svnkit', version='1.8.4')
import org.tmatesoft.svn.core.SVNURL
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory
import org.tmatesoft.svn.core.io.SVNRepositoryFactory
import org.tmatesoft.svn.core.wc.SVNWCUtil
url = "your_url"
name="jenkins"
password="jenkins123"
DAVRepositoryFactory.setup()
repo = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url))
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name,password)
repo.setAuthenticationManager( authManager )
def dirs = ["trunk"]
["branches","tags"].each{ dir ->
entries = repo.getDir(dir, -1, null, (Collection) null)
entries.each{ dirs.push(it) }
}
println dirs
This'll get you all your branches.
For use in Jenkins you'll have to remove the @Grab and instead have the library jars available in the workspace to be added to the JobDSL Class Path in the Build Step configuration.