将工件从 Ivy 部署到 Archiva

发布于 2024-08-09 14:06:45 字数 1548 浏览 5 评论 0原文

有没有人测试过如何在启用安全性的 Archiva 中部署工件。 我有以下配置

我的 ivysettings.xml

<ivysettings>
  <settings defaultResolver="archiva"/>
  <resolvers>
    <ibiblio name="archiva" 
             m2compatible="true" 
             root="http://localhost:8080/archiva/repository/internal/[organization]/[module]/[revision]/[artifact]-[revision].[ext]"/>
  </resolvers>
</ivysettings>

我的 build.xml

<target name="ivy-init">
  <ivy:settings file="${ivy.settings.dir}/ivysettings.xml"  refid="ivy.classpath">
    <credentials host="localhost" 
         realm="Repository Archiva Managed Internal Repository"
                 username="deploy_user" passwd="deploy_pwd" />
  </ivy:settings>             
</target>

<target name="deploy2Archiva" 
         depends="jar,local-maven-version">

   <ivy:makepom ivyfile="${ivy.file}"
         pomfile="dist/demo-core.pom">
       <mapping conf="compile" scope="compile"/>
       <mapping conf="test" scope="test"/>
   </ivy:makepom>


   <ivy:publish 
    resolver="public"
    pubrevision="${version}"
    overwrite="true"    
    pubdate="${now}"
    status="release"
    forcedeliver="true"
    artifactspattern="${dist.dir}/[artifact].[ext]"/>

</target>

我的 Archiva deploy_user 具有“存储库管理员”Archiva 角色,但我收到未经授权的消息。 事实上,似乎没有考虑凭据,因为如果我将“存储库管理器”设置为来宾 Archiva 用户(未经身份验证的用户),则会部署工件。

Archiva 使用协议 webdav。您是否已经使用 Ivy webdav 解析器进行了实验凭证? 对此有什么想法吗?

Is there anyone have tested how to deploy artifacts within Archiva which security enabled.
I have the following configuration

My ivysettings.xml

<ivysettings>
  <settings defaultResolver="archiva"/>
  <resolvers>
    <ibiblio name="archiva" 
             m2compatible="true" 
             root="http://localhost:8080/archiva/repository/internal/[organization]/[module]/[revision]/[artifact]-[revision].[ext]"/>
  </resolvers>
</ivysettings>

My build.xml

<target name="ivy-init">
  <ivy:settings file="${ivy.settings.dir}/ivysettings.xml"  refid="ivy.classpath">
    <credentials host="localhost" 
         realm="Repository Archiva Managed Internal Repository"
                 username="deploy_user" passwd="deploy_pwd" />
  </ivy:settings>             
</target>

<target name="deploy2Archiva" 
         depends="jar,local-maven-version">

   <ivy:makepom ivyfile="${ivy.file}"
         pomfile="dist/demo-core.pom">
       <mapping conf="compile" scope="compile"/>
       <mapping conf="test" scope="test"/>
   </ivy:makepom>


   <ivy:publish 
    resolver="public"
    pubrevision="${version}"
    overwrite="true"    
    pubdate="${now}"
    status="release"
    forcedeliver="true"
    artifactspattern="${dist.dir}/[artifact].[ext]"/>

</target>

My Archiva deploy_user has the 'Repository Manager' Archiva role but I get an unauthorized message.
In fact, the credentials doesn't seem to be into account because if I set the 'Repository Manager' to the guest Archiva user (unauthenticated user), the artifacts are deployed.

Archiva uses the protocol webdav. Have you got experimented credentials with an Ivy webdav resolver?
Any thoughts on this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

想你只要分分秒秒 2024-08-16 14:06:45

凭证元素的领域属性似乎区分大小写,因此您可能需要尝试使用realm =“Repository Archiva Managed Internal Repository”(请注意“internal”中的小写“i”!)

The realm attribute of the credentials element seems to be case-sensitive so you may want to try using realm="Repository Archiva Managed internal Repository" (note the lower case 'i' in 'internal'!)

夏九 2024-08-16 14:06:45

为此也遇到了很多麻烦。解决方案如下:

打开 Ant 的调试日志记录
在异常发生之前查找类似这样的消息:

[ivy:publish] 尝试获取以下凭据:存储库 Archiva 托管内部 [电子邮件受保护]

您需要在 ivysettings.xml 文件中添加与正在查找的内容相匹配的凭据,

<credentials
      host="domain.com"
      realm="Repository Archiva Managed internal Repository"
      username="username"
      passwd="password" />

The Realm 为“Repository Archiva Managed Internal Repository”,主机为“domain.com”,替换为任何内容值以及正确的用户名和密码显示在您的调试输出中。

我希望这对某人有帮助!

Was having a lot of trouble with this as well. Here's the solution:

Turn debug logging on for Ant
Look for a message like this just before the exception:

[ivy:publish] try to get credentials for: Repository Archiva Managed internal [email protected]

You need to add into your ivysettings.xml file credentials that match what it's looking for

<credentials
      host="domain.com"
      realm="Repository Archiva Managed internal Repository"
      username="username"
      passwd="password" />

The Realm being "Repository Archiva Managed internal Repository" and the host being "domain.com", replaced with whatever values are showing up in your debug output, as well as your correct username and password.

I hope this helps someone!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文