good ivy tutorial for local repository? [closed]

霸气de小男生 提交于 2019-11-26 15:47:16

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.

I have 3 files I want to publish:

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

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>

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.

Added: Publishing from within ANT

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

don't know if you're using SVN, if this is the case this may help:

http://code.google.com/p/ivysvn/

What you may want to look at doing is creating a private maven repository, either on your local machine, or in your intranet. Then deploy these non-public resources to that repository using maven. Ivy integrates with maven repositories, so you will be able to then pull these resources in during compile time.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!