The problem is that when Hudson checks out the files, it doesn't use symlinks. I've tried the svn13 and svn14 plug ins, but neither worked.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
In linux, edit your /etc/init.d/hudson script file:
Look for a line that looks like:
$SU $HUDSON_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- $JAVA $JAVA_ARGS -jar $HUDSON_WAR $HUDSON_ARGS" || return 2
Change it to:
$SU $HUDSON_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- $JAVA $JAVA_ARGS -Dsvnkit.symlinks=true -jar $HUDSON_WAR $HUDSON_ARGS" || return 2
Save the file and type:
sudo /etc/init.d/hudson stop
sudo /etc/init.d/hudson start
In summary, you're essentially looking to pass JAVA -Dsvnkit.symlinks=true so that symlinks are resolved to folders instead of a file.
回答2:
In CentOS, the line you should change reads:
JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"
Change it to:
JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -Dsvnkit.symlinks=true -jar $JENKINS_WAR"
And restart jenkins
回答3:
I'm not sure which version of the subversion plugin you've tried, but as of subversion plugin 1.30 it works out of the box.
I guess SVNKit at some point change the default from doing symlink by default, and Jenkins benefited from it.
回答4:
If you want to edit this setting per slave node, this worked for me:
From Jenkins UI:
- Disconnect node
- Click on slave node, Under Configure -> Advanced -> JVM Options:
- Add line: Dsvnkit.symlinks=true
- Relaunch slave