Svn Hudson subversion插件:参数化生成找不到凭据

Svn Hudson subversion插件:参数化生成找不到凭据,svn,continuous-integration,hudson,hudson-plugins,Svn,Continuous Integration,Hudson,Hudson Plugins,我试图在哈德逊建立一个参数化的建筑。它是一个字符串参数,将在我手动触发构建时设置。这是示例存储库url。 svn://xxx/java/common/tags/${revision} 当我尝试使用$revision=1.0.0.0进行构建时,出现了以下异常 error: failed to check out svn://xxx/java/common/tags/1.0.0.0 org.tmatesoft.svn.core.SVNCancelException: svn: No credenti

我试图在哈德逊建立一个参数化的建筑。它是一个字符串参数,将在我手动触发构建时设置。这是示例存储库url。
svn://xxx/java/common/tags/${revision}

当我尝试使用$revision=1.0.0.0进行构建时,出现了以下异常

error: failed to check out svn://xxx/java/common/tags/1.0.0.0
org.tmatesoft.svn.core.SVNCancelException: svn: No credential to try. Authentication failed
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(SVNErrorManager.java:37)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(SVNErrorManager.java:32)
    at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getFirstAuthentication(DefaultSVNAuthenticationManager.java:219)
    at org.tmatesoft.svn.core.internal.io.svn.sasl.SVNSaslAuthenticator.createSaslClient(SVNSaslAuthenticator.java:304)
    at org.tmatesoft.svn.core.internal.io.svn.sasl.SVNSaslAuthenticator.authenticate(SVNSaslAuthenticator.java:91)
    at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.authenticate(SVNConnection.java:173)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.authenticate(SVNRepositoryImpl.java:1265)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1243)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:168)
    at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:482)
    at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:873)
    at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:534)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:901)
我已经为上面的存储库url设置了用户名/密码。由于url是动态生成的,Subversion插件似乎无法获取凭据。如果我将URL设置为静态URL并相应地设置用户名/密码,我就可以签出该项目。任何帮助都将不胜感激。Thx

哈德逊版本:2.1.0

Subversion插件版本:2.0.1

我已经在我们的一个Hudson安装上对其进行了测试。我已经做了以下工作:

  • 创造了一份新的哈德逊工作
  • 将SVN URL复制到Ant项目,并将最后一段替换为`${project}

    之前是:
    https://our.svn.com/svn/trunk/public/develop/build/ant/ant-simple

    现在是:
    https://our.svn.com/svn/trunk/public/develop/build/ant/${project}

  • 然后我在构建中添加了一个参数:

    • 类型:字符串参数
    • 名称:项目
    • 默认值:antsimple
  • 作为构建步骤,我使用targetclean定义了Ant
  • 配置对话框告诉我存储库中不存在SVN URL(其中包含
    ${project}
    ),并提供更新凭据的功能。
  • 我不执行
    更新凭据
  • 当我现在启动构建时,它会请求参数(我不更改默认值),挂起几秒钟(带有消息
    pending-??
    ),然后执行正确的构建。之所以这样做有效(我怀疑,但你可以证明这一点),是因为Hudson有一个凭证缓存,如果可能的话,它正在使用该缓存


    作为一种解决方法,您应该在不使用参数的情况下启动一个生成作业(只需复制当前生成,并通过将URL设置为
    ../tags/1.0.0
    )来删除该参数),然后生成一次。您必须在那里输入正确的凭据,现在参数化的构建应该可以工作了。

    Thx mliebelt供您快速响应。不知怎的,我找到了一个解决办法。 这是我在hudson项目文件夹下找到的subversion.credentials

    您可以看到有一个将url映射到凭证的哈希表。 看看第三个条目。在运行时,解析参数$revision时,插件可能无法找到具有匹配密钥的凭据。 出于绝望,我添加了相同的凭证,带有“覆盖全局凭证”和“是”标志。这是下面的第四个条目。这似乎奏效了。我猜全局身份验证只基于主机名存储

    <?xml version='1.0' encoding='UTF-8'?>
    <hudson.scm.PerJobCredentialStore>
      <credentials class="hashtable">
        <entry>
          <string>svn://xxx/java/common</string>
          <hudson.scm.SubversionSCM_-DescriptorImpl_-PasswordCredential>
            <userName>chiangs</userName>
            <password>MWNoaWFuZ3MyMw==</password>
          </hudson.scm.SubversionSCM_-DescriptorImpl_-PasswordCredential>
        </entry>
        <entry>
          <string>svn://xxx/java/common/trunk</string>
          <hudson.scm.SubversionSCM_-DescriptorImpl_-PasswordCredential>
            <userName>chiangs</userName>
            <password>MWNoaWFuZ3MyMw==</password>
          </hudson.scm.SubversionSCM_-DescriptorImpl_-PasswordCredential>
        </entry>
        <entry>
          <string>svn://xxx/java/common/tags/${revision}</string>
          <hudson.scm.SubversionSCM_-DescriptorImpl_-PasswordCredential>
            <userName>chiangs</userName>
            <password>MWNoaWFuZ3MyMw==</password>
          </hudson.scm.SubversionSCM_-DescriptorImpl_-PasswordCredential>
        </entry>
        <entry>
          <string>&lt;svn://xxx:3690&gt; 01f58c58-b008-11dd-a3df-af2b63c5a78d</string>
          <hudson.scm.SubversionSCM_-DescriptorImpl_-PasswordCredential reference="../../entry[2]/hudson.scm.SubversionSCM_-DescriptorImpl_-PasswordCredential"/>
        </entry>
      </credentials>
    </hudson.scm.PerJobCredentialStore>
    
    
    svn://xxx/java/common
    蒋介石
    MWnoawfux3MmW==
    svn://xxx/java/common/trunk
    蒋介石
    MWnoawfux3MmW==
    svn://xxx/java/common/tags/${revision}
    蒋介石
    MWnoawfux3MmW==
    svn://xxx:3690 01f58c58-b008-11dd-a3df-af2b63c5a78d
    
    您能解释一下参数化构建的含义吗?当我做一个新的构建作业,并选中复选框
    此构建是参数化的
    ,我只有几个选项。你在那里用过哪一种?它是一个字符串参数,然后在URL中用于Subversion吗?请将此信息添加到问题中。是的,这是一个字符串参数,在我的URL中用于subversion。