这似乎是一个简单的任务,但对于我来说,我无法让 Hudson 将我的源代码 checkout 到特定目录。 我可以在命令行上使用 svn 查看源代码。 我尝试在源代码管理下指定本地模块设置,但没有骰子。
我将其设置为 c:\source\trunk,当我运行构建时我得到了这个。
Started by user anonymous
Checking out http://mysvnserver/trunk
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Unknown Source)
at java.io.File.getCanonicalPath(Unknown Source)
at java.io.File.getCanonicalFile(Unknown Source)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:742)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:660)
at hudson.FilePath.act(FilePath.java:753)
at hudson.FilePath.act(FilePath.java:735)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:653)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:601)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1082)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
at hudson.model.Run.run(Run.java:1280)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:293)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:137)
Finished: FAILURE
当我尝试设置相对路径时,它说我不能使用绝对目录。 即\source\trunk
我想要发生的就是 hudson 将我的源代码 checkout 到 c:\source\trunk
最佳答案
正如履行机构已经说过的:
Paths like the SVN are relative to the Workspace root. At least that's what the help for "Local module directory" says on the Job configuration page.
当您以“\”开始路径时,意味着该路径是绝对路径。您有两个选择。
- 为您的工作定义自定义工作区。这可能是 c:\source,并且源的 checkout 将是到 trunk(或者如果 checkout 您的 svn url 以“/trunk”结尾,则将其留空。
- 将其 checkout 到标准工作区,然后将其复制到 C:\source\trunk。
顺便说一句,我更喜欢第二种选择,因为我几乎不惜一切代价尝试避免自定义工作区。
关于svn - 让 hudson 将源 checkout 到特定目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3866732/