将工件从 Ivy 部署到 Archiva
有没有人测试过如何在启用安全性的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
凭证元素的领域属性似乎区分大小写,因此您可能需要尝试使用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'!)
为此也遇到了很多麻烦。解决方案如下:
打开 Ant 的调试日志记录
在异常发生之前查找类似这样的消息:
您需要在 ivysettings.xml 文件中添加与正在查找的内容相匹配的凭据,
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:
You need to add into your ivysettings.xml file credentials that match what it's looking for
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!