I wanted to do svn operations from as groovy script without going near the svnkit API.
The other problem was having the runtime dependencies available from wherever the script is run from.
@GrabConfig(systemClassLoader=true)
@GrabResolver(name="fid", root="http://path-to-internal-repo/nexus/content/groups/mygroup")
@Grab(group='org.tmatesoft.svnkit', module='svnkit', version='1.3.5')
@Grab(group='org.tigris', module='svnant', version='1.3.0')
@Grab(group='org.tigris', module='svnClientAdapter', version='0.9.102')
@Grab(group='org.tmatesoft.svnkit', module='svnkit-javahl', version='1.3.5')
def message='Commited by jenkins admin - updated parent pom to my:parent:1.23'
def ant = new AntBuilder()
ant.svn(username:"username", password:"password",failonerror:"false") {
commit(file: pomFile, message:message )
}
ant.typedef(resource: "org/tigris/subversion/svnant/svnantlib.xml")
ant.svn(username:"user", password:"password")
{
checkout(url: "svn://svnserver/project/trunk", destPath: "/home/user/topath")
}
Using ~/.groovy/grapeConfig.xml
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes">
<ibiblio name="local" root="file:${user.home}/.m2/repository/" m2compatible="true"/>
<filesystem name="cachedGrapes">
<ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
<ibiblio name="fid" root="http://path-to-internal-repo/nexus/content/groups/mygroup" m2compatible="true"/>
<!-- todo add 'endorsed groovy extensions' resolver here -->
<!--<ibiblio name="ibiblio" m2compatible="true"/> -->
</chain>
</resolvers>
</ivysettings>
No comments:
Post a Comment