title: How to setup Authorization Hudson /Jenkins to clone your mercurial repository
body: <p>After installing and playing around with mercurial , I am trying to get Hudson to clone the repository so it can build my project.</p>
  
  <p>At the moment the following task works.</p>
  
  <ul>
  <li>I Can sync to my external host and the code shows up on that host.</li>
  </ul>
  
  <p>Now I am trying to configure hudson / jenkins to access the code on my host.</p>
  
  <p>But unfortunately I am rolling on a error: </p>
  
  <pre><code>Started by user anonymous
  $ hg clone --rev default https://bitbucket.org/*/testproject "F:\Hudson\jobs\testproject\workspace"
  abort: http authorization required
  ERROR: Failed to clone https://bitbucket.org/*/testproject
  [workspace] $ hg log --rev . --template {node}
  java.io.IOException: Cannot run program "hg" (in directory "F:\Hudson\jobs\testproject\workspace"): CreateProcess error=267, The directory name is invalid
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
      at hudson.Proc$LocalProc.&lt;init&gt;(Proc.java:244)
      at hudson.Proc$LocalProc.&lt;init&gt;(Proc.java:216)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:698)
      at hudson.Launcher$ProcStarter.start(Launcher.java:329)
      at hudson.Launcher$ProcStarter.join(Launcher.java:336)
      at hudson.plugins.mercurial.MercurialSCM.joinWithPossibleTimeout(MercurialSCM.java:298)
      at hudson.plugins.mercurial.HgExe.popen(HgExe.java:191)
      at hudson.plugins.mercurial.HgExe.tip(HgExe.java:171)
      at hudson.plugins.mercurial.MercurialSCM.calcRevisionsFromBuild(MercurialSCM.java:254)
      at hudson.scm.SCM._calcRevisionsFromBuild(SCM.java:304)
      at hudson.model.AbstractProject.calcPollingBaseline(AbstractProject.java:1186)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1175)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:523)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:418)
      at hudson.model.Run.run(Run.java:1362)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:145)
  Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid
      at java.lang.ProcessImpl.create(Native Method)
      at java.lang.ProcessImpl.&lt;init&gt;(ProcessImpl.java:81)
      at java.lang.ProcessImpl.start(ProcessImpl.java:30)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
      ... 18 more
  Finished: FAILURE
  </code></pre>
  
  <p>What actions do i need to do to tell Hudson to use username x and password y to acces the data?</p>
  
  <p><strong>Edited</strong> => Found how to integrate ssh .</p>