如何配置播放框架以将我的工件存储库用于所有依赖项?

发布于 2024-12-09 10:02:26 字数 432 浏览 0 评论 0原文

我正在尝试添加一个本地 Maven 存储库,该存储库是我使用用于缓存 Maven 存储库的神器设置的。按照 依赖说明 我找到了如何使用 contains 属性设置存储库这限制了存储库的内容。我想做的是让这个存储库用于所有内容,有没有办法配置它?

repositories:
    - artifactory:  
        type:       iBiblio
        artifact:   "http://myartifactoryhost.com/artifactory/libs-release"
        contains:
            - foo-bars -> *

I am trying to add a local maven repository that I have set up using artifactory which I use to cache maven repositories. Following the dependency instructions I have found how to set up a repository with a contains attribute that scopes what the repository has. What I would like to do is have this repository used for everything, is there a way to configure that?

repositories:
    - artifactory:  
        type:       iBiblio
        artifact:   "http://myartifactoryhost.com/artifactory/libs-release"
        contains:
            - foo-bars -> *

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

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

发布评论

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

评论(2

花开半夏魅人心 2024-12-16 10:02:26

您可以将以下内容放入 $HOME/.ivy2/ivysettings.xml

这将使 ivy (并因此发挥依赖解析)首先查看本地 maven 存储库,然后使用您的存储库管理器(类似于 .m2/settings.xml 中的mirrorOf * )。

<ivy-settings>
    <!-- path to local maven repo and default maven layout -->
    <property name="local-maven2-pattern" value="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision]" override="false" />
    <!-- set resolver chain as default -->
    <settings defaultResolver="main" />
    <!-- configure caches -->
    <caches repositoryCacheDir="${user.home}/.ivy2/cache">
        <!-- do not cache from local .m2-->
        <cache name="nocache" useOrigin="true" />
        <cache name="default" />
    </caches>
    <resolvers>
        <chain name="main">
            <!-- as this is not cached, even changing SNAPSHOT dependencies are resolved correctly -->
            <filesystem name="local-maven-2" m2compatible="true" local="true" cache="nocache">
                <ivy pattern="${local-maven2-pattern}.pom" />
                <artifact pattern="${local-maven2-pattern}(-[classifier]).[ext]" />
            </filesystem>
            <!-- use repository manager as proxy to maven-central (and alle other repositories)--> 
            <ibiblio name="repomanager" m2compatible="true"root="http://your.repomanager.intra/path/to/repo" cache="default"/>
        </chain>
    </resolvers>
</ivy-settings>

You can put the following to $HOME/.ivy2/ivysettings.xml

This will make ivy (and therefore play dependency resolution) first look in local maven repo and then use your repo manager (similar to mirrorOf * in .m2/settings.xml).

<ivy-settings>
    <!-- path to local maven repo and default maven layout -->
    <property name="local-maven2-pattern" value="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision]" override="false" />
    <!-- set resolver chain as default -->
    <settings defaultResolver="main" />
    <!-- configure caches -->
    <caches repositoryCacheDir="${user.home}/.ivy2/cache">
        <!-- do not cache from local .m2-->
        <cache name="nocache" useOrigin="true" />
        <cache name="default" />
    </caches>
    <resolvers>
        <chain name="main">
            <!-- as this is not cached, even changing SNAPSHOT dependencies are resolved correctly -->
            <filesystem name="local-maven-2" m2compatible="true" local="true" cache="nocache">
                <ivy pattern="${local-maven2-pattern}.pom" />
                <artifact pattern="${local-maven2-pattern}(-[classifier]).[ext]" />
            </filesystem>
            <!-- use repository manager as proxy to maven-central (and alle other repositories)--> 
            <ibiblio name="repomanager" m2compatible="true"root="http://your.repomanager.intra/path/to/repo" cache="default"/>
        </chain>
    </resolvers>
</ivy-settings>
我做我的改变 2024-12-16 10:02:26

您可以使用本地存储库之类的东西配置并将所有内容放在那里。在您的情况下,本地存储库将指向您的工件主机。

请注意,您无法替换“play”条目,尽管您可以将模块的本地副本添加到存储库中以使用它们。

You can use something like the local repository configuration and put everything in there. In your case the local repo would point to your artifacts host.

Be aware you can't replace the "play" entry, although you can add local copies of modules to your repository to use them.

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