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

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

问题描述

任何人都可以点我的一个很好的教程制作和放大器;使用带有常春藤本地存储库? (请不要在常春藤文档点我的教程是相当混乱的)

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.

推荐答案

创建本地常春藤库是直线前进,不需要行家。下面是使用发布常青藤作为一个独立的程序,一些文本文件的一个例子。

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>

您还需要一个常青藤设置文件告诉常春藤所在的库位于

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>

最后运行常春藤发布的发布的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 

请注意发布模式。它告诉常春藤其中要发布的文件的位置。

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天全站免登陆