Apache Ivy:指向存储库管理器

发布于 2025-01-07 14:01:00 字数 1627 浏览 0 评论 0原文

我正在尝试配置 Ivy 以与 Artifactory(一个流行的存储库管理器)很好地配合,并且需要确认我正在走正确的道路。

我假设一旦我在存储库服务器上正确配置了 Artifactory,我就可以将 Ivy 指向 ARTIFACTORY_HOME 下的某个目录,并向其传递与普通 URL 解析器相同的信息。这样,Artifactory 就会传递信息(要处理的命令、用户名和密码等)并代表实际的存储库接管。 (因此,如果凭据错误或者用户无权履行请求,Artifactory 会发回 404/等。)

首先,如果这是错误的,请纠正我!

这就是我的想法。在我的项目的 Ant 构建中:

<ivy:settings url="http://my-repo-server.com/ivy/settings/ivy-settings.xml"/>

<target name="ivy-resolve">
    <ivy:configure host="http://my-repo-server.com/ivy"
        realm="ivy"
        username="developer" <!-- "developer" is read-only user configured in Artifactory -->
        passwd="38ur84u83j38y83u" <!-- encrypted password provided by Artifactory -->
        override="false"/>
    <ivy:resolve file="ivy.xml" conf="compile"/>
</target>

然后,在(服务器端)ivy-settings.xml 中:

<resolvers>  
    <url name="repo-server">
        <ivy pattern="http://my-repo-server.com/ivy/???"/>
        <artifact pattern="http://my-repo-server.com/ivy/???"/>
    </url>
</resolvers>

因此,当开发人员的 Ant 构建运行 ivy-resolve 目标时,ivy 客户端知道在哪里查找 ivy-settings.xml 文件,并使用我在 Artifactory 中设置的 developer 用户和加密密码进行自身配置。

唯一的问题是,我不确定要为 Ivy & 指定什么。设置文件中的工件模式?我假设我必须将它们设置到由 Artifactory 控制的某个目录,但我不确定是什么(在 Artifactory 中,我的存储库使用默认的 Ivy 存储库布局)。

另外,我像我一样将设置文件放在存储库服务器上是否违反了 Artifactory“最佳实践”?我应该将它放在 Artifactory 管理的(隐藏)目录中吗?如果有,在哪里以及为什么?

最终,代码示例帮助我更快地学习。最简单(我是一个图形学习者),因此任何朝着正确方向的程序性推动都将受到极大的赞赏!

提前致谢!

I'm trying to configure Ivy to play nicely with Artifactory (a popular repository manager) and need confirmation that I'm heading down the right path here.

I assume that once I have Artifactory configured correctly on my repository server, that I can just point Ivy to some directory under ARTIFACTORY_HOME and pass it the same information as I would an ordinary URL resolver. This way, Artifactory gets passed the info (what command to process, username & password, etc.) and takes over on the actual repositories behalf. (Thus, if credentials are wrong or if the user doesn't have permission to honor the request, Artifactory sends back a 404/etc.)

So to start with, if this is wrong, please correct me!

So here is what I'm thinking. In the Ant build for my project:

<ivy:settings url="http://my-repo-server.com/ivy/settings/ivy-settings.xml"/>

<target name="ivy-resolve">
    <ivy:configure host="http://my-repo-server.com/ivy"
        realm="ivy"
        username="developer" <!-- "developer" is read-only user configured in Artifactory -->
        passwd="38ur84u83j38y83u" <!-- encrypted password provided by Artifactory -->
        override="false"/>
    <ivy:resolve file="ivy.xml" conf="compile"/>
</target>

And then, in the (server-side) ivy-settings.xml:

<resolvers>  
    <url name="repo-server">
        <ivy pattern="http://my-repo-server.com/ivy/???"/>
        <artifact pattern="http://my-repo-server.com/ivy/???"/>
    </url>
</resolvers>

So when a developer's Ant build runs the ivy-resolve target, the Ivy client knows where to go to find the ivy-settings.xml file, and configures itself using the developer user and encrypted password that I set up in Artifactory.

The only problem is, I'm not sure what to specify for Ivy & Artifact patterns in the settings file? I assume I have to set them to some directory that is controlled by Artifactory, but I'm not sure what (in Artifactory my repo uses the default Ivy repo layout).

Also, am I violating Artifactory "best practices" by placing the settings file on the repo server like I did? Should I place it inside some Artifactory-managed (hidden) directory? If so, where and why?

Ultimately, code samples help me learn fastest & easiest (I'm a graphical learner), so any programmatic nudges in the right direction are enormously appreciated!

Thanks in advance!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文