本文介绍了如何配置播放框架以将我的工件存储库用于所有依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试添加使用人工制品设置的本地Maven储存库,该人工制品用于缓存Maven储存库.遵循依赖性说明,我发现了如何设置包含contains属性的存储库范围存储库的范围.我想做的就是将此存储库用于所有内容,有没有一种配置方法?

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 -> *

推荐答案

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

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

这将使常春藤(从而发挥依赖性解析)首先在本地Maven存储库中查找,然后使用您的存储库管理器(类似于.m2/settings.xml中的mirrorOf *).

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>

这篇关于如何配置播放框架以将我的工件存储库用于所有依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 23:32