我正在與Jenkins合作執行構建並運行我的Ant代碼。SvnAnt掛起提交重命名的SVN文件夾
Jenkins將SVN文件簽出處理到我的工作區。我使用SvnAnt將更改提交到文件。在這種情況下,我需要時提交新的FLA文件。這適用於我的所有版本,但其中一個,這個版本的主要區別在於,在源SVN文件中,在檢出的某個文件夾中存在提交的錯字,用戶SVN將該文件夾和檢出的內容重命名爲構建節點被刪除。當這個構建被修改(需要添加新的FLA文件)時,構建會一直到提交部分並掛起。
這種情況的代碼如下:
<!-- load the svn task -->
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<target name="commitFLA">
<echo>=== COMMIT FLA FILES TO THE ${dita.map.filename.root} MODULE FOLDER ===</echo>
<svn username="${username}" password="${password}">
<add dir="${workspace}\${dita.map.filename.root}\" force="true" />
<commit dir="${workspace}\${dita.map.filename.root}" message="Added FLA Template Files for the ${dita.map.filename.root} Module" />
</svn>
</target>
下面就是詹金斯表示:
commitFLA:
[echo] === COMMIT FLA FILES TO THE TTWCS_Sys_Admin MODULE FOLDER ===
[svn] <Add> started ...
[svn] <Add> finished.
[svn] <Commit> started ..
現在,如果我已經犯下的所有文件,並沒有改變在構建工作取得它工作得很好:
commitFLA:
[echo] === COMMIT FLA FILES TO THE TTWCS_Sys_Admin MODULE FOLDER ===
[svn] <Add> started ...
[svn] <Add> finished.
[svn] <Commit> started ...
[svn] <Commit> finished.
在這一點上,我對什麼事情不知所措。我需要知道是否有日誌輸出,我可以把它輸出,所以我知道問題是什麼。這段代碼在多個構建作業中使用,除了這個和其他一些與這個問題沒有特別關係,但使用類似的提交代碼結構的作品外,它們都可以正常工作。我希望修復這個問題可以解決其他問題。
編輯:從JSTACK添加蹤跡乍得Nouis
2016-01-07 11:39:02
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode):
"Timer-0" #27 daemon prio=5 os_prio=0 tid=0x00000000546c3800 nid=0x5120 in Object.wait() [0x0000000056e1e000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.util.TimerThread.mainLoop(Unknown Source)
- locked <0x00000000daf5c040> (a java.util.TaskQueue)
at java.util.TimerThread.run(Unknown Source)
"Thread-11" #25 daemon prio=5 os_prio=0 tid=0x0000000053d87000 nid=0x4d88 in Object.wait() [0x0000000056cdf000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x00000000daf5c1d0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at org.tmatesoft.svn.core.javahl.SVNClientImplTracker.run(SVNClientImplTracker.java:53)
at java.lang.Thread.run(Unknown Source)
"Service Thread" #8 daemon prio=9 os_prio=0 tid=0x0000000052325800 nid=0x5080 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C1 CompilerThread1" #7 daemon prio=9 os_prio=2 tid=0x0000000052320800 nid=0x4544 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" #6 daemon prio=9 os_prio=2 tid=0x00000000522c7000 nid=0x4e58 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x00000000522c2800 nid=0x5178 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x00000000522c1000 nid=0x5114 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x0000000001e99000 nid=0x53a4 in Object.wait() [0x000000005285f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x00000000d5577718> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x0000000001e97800 nid=0x526c in Object.wait() [0x00000000526de000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Unknown Source)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
- locked <0x00000000d55778d0> (a java.lang.ref.Reference$Lock)
"main" #1 prio=5 os_prio=0 tid=0x00000000003af000 nid=0x50c4 runnable [0x00000000020fd000]
java.lang.Thread.State: RUNNABLE
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
- locked <0x00000000c45b9478> (a java.net.DualStackPlainSocketImpl)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createSSLSocket(SVNSocketFactory.java:65)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:167)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:304)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:257)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:245)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:454)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:97)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:643)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getRepositoryRoot(DAVRepository.java:128)
at org.tmatesoft.svn.core.wc.SVNCommitClient.doCommit(SVNCommitClient.java:996)
at org.tmatesoft.svn.core.wc.SVNCommitClient.doCommit(SVNCommitClient.java:891)
at org.tmatesoft.svn.core.wc.SVNCommitClient.doCommit(SVNCommitClient.java:823)
at org.tmatesoft.svn.core.javahl.SVNClientImpl.commit(SVNClientImpl.java:665)
at org.tmatesoft.svn.core.javahl.SVNClientImpl.commit(SVNClientImpl.java:648)
at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.commit(AbstractJhlClientAdapter.java:310)
at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.commit(AbstractJhlClientAdapter.java:284)
at org.tigris.subversion.svnant.commands.Commit.svnCommitDir(Unknown Source)
at org.tigris.subversion.svnant.commands.Commit.execute(Unknown Source)
at org.tigris.subversion.svnant.commands.SvnCommand.executeCommand(Unknown Source)
at org.tigris.subversion.svnant.SvnTask.execute(Unknown Source)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
"VM Thread" os_prio=2 tid=0x0000000001e91800 nid=0x4fb0 runnable
"VM Periodic Task Thread" os_prio=2 tid=0x000000005232a800 nid=0x5330 waiting on condition
JNI global references: 99
爲了幫助解決問題,請考慮使用jstack。當SvnAnt似乎掛起時,[使用jstack打印掛起的Ant Java進程的堆棧痕跡](http://www.herongyang.com/Java-Tools/jstack-JVM-Thread-Dump-Stack-Strace.html )。然後編輯您的問題以添加堆棧跟蹤。我們可能能夠更準確地確定問題。 –
我發現了此問題的修復程序。問題在於SVN的簽出版本(來自Jenkins插件)太低而無法提交到我們的jenkins服務器。如果我使用SVNAnt來檢出我想提交更改的存儲庫,那麼我可以使用SVNAnt將新文件添加/提交到SVN,而不會出現任何問題。 – kminke