Get hudson to checkout source to a specific directory

情到浓时终转凉″ 提交于 2019-12-12 19:30:21

问题


This seems like a simple task but for the life of me I can't get Hudson to checkout my source to a specific directory. I can checkout the source using svn on the command line. I tried specifying the Local Module setting under source code management but no dice.

I set it to c:\source\trunk and I get this when i run the build.

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

When i try to set a relative path it says I can't use absolute directories. i.e \source\trunk

All i want to have happen is hudson checkout my source to c:\source\trunk


回答1:


As sbi already said:

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.

When you start a path with '\' than it means that the path is absolute. You have two options.

  1. Define a custom workspace for your job. This could be c:\source and the checkout of the source would be to trunk (or leave it empty if checking out your svn url ends with '/trunk'.
  2. check it out to your standard workspace and then copy it to C:\source\trunk.

BTW, I would favor the second option, because I try to avoid the custom workspace at almost all costs.




回答2:


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.




回答3:


The other workaround is to create MAster-Slave config in the same system on which Hudson is running. Create a slave on the same machine and point to the location where yu want yur projet to checkout in the Slave configuration



来源:https://stackoverflow.com/questions/3866732/get-hudson-to-checkout-source-to-a-specific-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!