本地存储库的良好常春藤教程? [英] good ivy tutorial for local repository?

查看:26
本文介绍了本地存储库的良好常春藤教程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能给我指点一个制作 & 的好教程?将本地存储库与 Ivy 一起使用?(请不要将我指向 Ivy 文档,教程相当混乱)

Can anyone point me at a good tutorial for making & using a local repository with Ivy? (Please don't point me at the Ivy docs, the tutorials are rather confusing)

我需要创建一个本地存储库以包含不一定可通过公共 maven 存储库获得的 .jar 文件.

I need to make a local repository to include .jar files that aren't necessarily available through the public maven repositories.

推荐答案

创建本地 ivy 存储库很简单,不需要 maven.下面是使用 ivy 作为独立程序发布一些文本文件的示例.

Creating a local ivy repository is straight forward, maven is not required. Here's an example of publishing some text files using ivy as a standalone program.

我有 3 个文件要发布:

I have 3 files I want to publish:

src/English.txt
src/Spanish.txt
src/Irish.txt

ivy 文件 src/ivy.xml 详细说明了模块的名称和发布的工件列表.(发布索引)

The ivy file src/ivy.xml details the name of the module and a list of the artifacts being published. (Release index)

<ivy-module version="2.0">
  <info organisation="myorg" module="hello"/>
  <publications>
    <artifact name="English" ext="txt" type="doc"/>
    <artifact name="Irish" ext="txt" type="doc"/>
    <artifact name="Spanish" ext="txt" type="doc"/>
  </publications>
</ivy-module>

您还需要一个 ivy 设置文件来告诉 ivy 存储库的位置

You'll also need an ivy settings file to tell ivy where the repository is located

<ivysettings>
    <property name="repo.dir" value=".../repo"/>
    <settings defaultResolver="internal"/>
    <resolvers>
        <filesystem name="internal">
            <ivy pattern="${repo.dir}/[module]/ivy-[revision].xml" />
            <artifact pattern="${repo.dir}/[module]/[artifact]-[revision].[ext]" />
        </filesystem>
    </resolvers>
</ivysettings>

最后运行ivy发布1.0版本:

Finally run ivy to publish the released version 1.0:

java -jar $IVY -settings config/ivysettings.xml \
        -ivy src/ivy.xml \
        -publish internal \
        -publishpattern "src/[artifact].[ext]" \
        -revision 1.0 \
        -status release \
        -overwrite 

注意发布模式.它告诉ivy要发布的文件所在的位置.

Note the publish pattern. It tells ivy where the files to be published are located.

<target name="publish" depends="clean,package" description="Publish this build into repository">
    <ivy:publish pubrevision="${pub.version}" status="${pub.status}" resolver="${pub.resolver}" >
        <artifacts pattern="${build.dir}/dist/[artifact].[ext]"/>
    </ivy:publish>
</target>

这篇关于本地存储库的良好常春藤教程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆