让ivy不下载源文件和许可证文件

发布于 2024-10-06 05:27:15 字数 1944 浏览 3 评论 0原文

有没有办法配置ivy不下载源&通过ivy.xml 的许可证文件?

我目前正在尝试使用默认的 ivy 存储库 + spring 存储库。我的ivysettings.xml如下:

<?xml version="1.0" encoding="ISO-8859-1"?>

<settings defaultResolver="springSource" />
<include url="${ivy.default.settings.dir}/ivysettings-public.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-shared.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml" />
<resolvers>
    <chain name="springSource">
        <url name="com.springsource.repository.bundles.release">
            <ivy
                pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            <artifact
                pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        </url>

        <url name="com.springsource.repository.bundles.external">
            <ivy
                pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            <artifact
                pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        </url>

        <ibiblio name="public" m2compatible="true" />
        <ibiblio name="shared" m2compatible="true" />
        <ibiblio name="local" m2compatible="true" />
        <ibiblio name="main-chain" m2compatible="true" />
        <ibiblio name="default-chain" m2compatible="true" />
    </chain>
</resolvers>

Is there a way to configure ivy not to download sources & license files via ivy.xml ?

I'm currently trying to use default ivy repos + spring repository. my ivysettings.xml is bellow:

<?xml version="1.0" encoding="ISO-8859-1"?>

<settings defaultResolver="springSource" />
<include url="${ivy.default.settings.dir}/ivysettings-public.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-shared.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml" />
<resolvers>
    <chain name="springSource">
        <url name="com.springsource.repository.bundles.release">
            <ivy
                pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            <artifact
                pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        </url>

        <url name="com.springsource.repository.bundles.external">
            <ivy
                pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            <artifact
                pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        </url>

        <ibiblio name="public" m2compatible="true" />
        <ibiblio name="shared" m2compatible="true" />
        <ibiblio name="local" m2compatible="true" />
        <ibiblio name="main-chain" m2compatible="true" />
        <ibiblio name="default-chain" m2compatible="true" />
    </chain>
</resolvers>

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

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

发布评论

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

评论(1

缱倦旧时光 2024-10-13 05:27:15

使用ivy配置指定您想要的到依赖项的依赖关系的映射(称为传递依赖项):

不知道您使用的spring是什么版本,本示例下载spring版本3.0:

<ivy-module version="2.0">
    <info organisation="com.myspotontheweb" module="demo"/>
    <configurations>
        <conf name="compile" description="Compile classpath"/>
    </configurations>
    <dependencies>
        <dependency org="org.springframework" name="org.springframework.core" rev="3.0.0.RELEASE" conf="compile->default"/>
    </dependencies>
</ivy-module>

引用Maven模块配置时参考Maven <强>范围。 Maven 中的默认范围是 compile,但您可以引用任何其他公共范围。

附加说明

我使用的是一个更简单的设置文件:

<ivysettings>
    <settings defaultResolver="chain"/>
    <resolvers>
        <chain name="chain">
            <ibiblio name="central" m2compatible="true"/>
            <ibiblio name="spring-release"  root="http://repository.springsource.com/maven/bundles/release" m2compatible="true"/>
            <ibiblio name="spring-external" root="http://repository.springsource.com/maven/bundles/external" m2compatible="true"/>
        </chain>
    </resolvers>
</ivysettings>

在我看来 ibiblio 解析器是与远程 Maven 存储库集成的最简单方法。我认为这个令人困惑的名称是历史性的,可以追溯到第一个 Maven 存储库站点的原始名称。您还需要另外指定 m2兼容 属性,因为原始 Maven 1 存储库格式现在几乎未知。

也许有一天,ivy 开发人员将创建一个新的“maven”解析器,让新用户的生活变得更轻松。

Use ivy configurations to specify your desired mapping to the dependencies of your dependencies (Called transitive dependencies):

Don't know what version of spring you're using, this example downloads spring version 3.0:

<ivy-module version="2.0">
    <info organisation="com.myspotontheweb" module="demo"/>
    <configurations>
        <conf name="compile" description="Compile classpath"/>
    </configurations>
    <dependencies>
        <dependency org="org.springframework" name="org.springframework.core" rev="3.0.0.RELEASE" conf="compile->default"/>
    </dependencies>
</ivy-module>

When referencing a Maven module configurations refer to Maven scopes. The default scope in Maven would be compile, but you can reference any other public scope.

Additional note

I'm using a much simpler settings file:

<ivysettings>
    <settings defaultResolver="chain"/>
    <resolvers>
        <chain name="chain">
            <ibiblio name="central" m2compatible="true"/>
            <ibiblio name="spring-release"  root="http://repository.springsource.com/maven/bundles/release" m2compatible="true"/>
            <ibiblio name="spring-external" root="http://repository.springsource.com/maven/bundles/external" m2compatible="true"/>
        </chain>
    </resolvers>
</ivysettings>

In my opinion the ibiblio resolver is the easiest way to integrate with a remote Maven repository. I think the confusing name is historical, dating back to the original name of the first Maven repository site. You'll need to additionally specify the m2compatible attribute, since the original Maven 1 repository format is now almost unknown.

Perhaps one day the ivy developers will create a new "maven" resolver that will make life easier for new users.

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