0

我正在使用两个命名不一致的常春藤存储库,我正在考虑使用命名空间来帮助映射,但命名空间是否会影响除“安装”之外的操作,例如“解析”?

4

1 回答 1

0

我刚刚在手册中找到了命名空间 doco .... 我认为这种方法过于复杂。

我建议使用适当的文件系统模式创建两个存储库声明,如下所示:

<ivysettings>
  <settings defaultResolver="central"/>
  <resolvers>
    <!-- Default resolver used to resolve 3rd party software from Maven Central -->
    <ibiblio name="central" m2compatible="true"/>

    <!-- Team1's repository. ivy and artifact patterns can be customized -->
    <filesystem name="team1-repo">
      <ivy pattern="${ivy.settings.dir}/repo/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
      <artifact pattern="${ivy.settings.dir}/repo/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
    </filesystem>

    <!-- Team2's repository. ivy and artifact patterns can be customized -->
    <filesystem name="team2-repo">
      <ivy pattern="${ivy.settings.dir}/repo/2/[organisation]/[module]/ivys/ivy-[revision].xml"/>
      <artifact pattern="${ivy.settings.dir}/repo/2/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
    </filesystem>
  </resolvers>

  <!-- This optional section tells which resolver to use. 
       Alternative setup a chain resolver above -->
  <modules>
    <module organisation="team1" name=".*" resolver="team1-repo" />
    <module organisation="team2" name=".*" resolver="team2-repo" />
  </modules>
</ivysettings>

笔记:

  • 显然,如果 ivy 存储库位于远程,则可以更新此示例以使用 url 解析器。
于 2013-07-12T11:51:40.380 回答