Показаны сообщения с ярлыком ivy. Показать все сообщения
Показаны сообщения с ярлыком ivy. Показать все сообщения

четверг, 30 января 2014 г.

Deploy artifacts from Ivy to Artifactory

After some time struggling with deploying jar files to Apache Archiva I decided to throw it out and replace with Artifactory oss version.
The installation of Artifactory is simple - just drop the war file into Tomcat webapp.

What is important for me is that Artifactory supports deployment of artifacts with Ivy.

среда, 17 июля 2013 г.

Apache Ivy. My experience.

I've been using Apache Ant for a long time. It is easy to use. But the most feature it lacks is a project dependency management. Moreover, I need not just resolve the open source projects, but to resolve my own projects.

In my development I have 2 projects that share common classes, which are in a third project. I also have a continues integration server. All projects are build on it and later deployed.

I found that Apache Ivy best suites my need. The reasons for this are:
  • it does integrate with Ant. 
  • it takes minimum intervention into the project to use Ivy. 
  • it has tutorials and good documentation. 

What I like is that in default configuration Ivy offers you a local repository. All you have to do is write an ivy.xml file, which describes your project and dependencies and modify build.xml.

In my situation I write the ivy.xml, that describes the shared project like this:
<ivy-module version="2.0">
    <info organisation="my" module="common"/>
    <publications>
      <artifact name="common" type="jar" />
    </publications>
</ivy-module>

And modified build.xml to publish project like this:
<!-- =================================
          target: publish-local
         ================================= -->
<target name="publish-local" depends="jar" description="--> publish this project in the local ivy repository">
        <tstamp>
            <format property="now" pattern="yyyyMMddHHmmss" />
        </tstamp>
        <ivy:publish artifactspattern="${dist.dir}/[artifact].[ext]" resolver="local" pubrevision="${version}" pubdate="${now}" forcedeliver="true" />
        <echo message="project ${ant.project.name} published locally with version ${version}" />
        <ivy:cleancache />
    </target>

In my other projects which depends on a "common.jar" I write the following ivy.xml:
<ivy-module version="2.0">
    <info organisation="my" module="booking"/>
    <dependencies>
        <dependency name="common" rev="latest.integration" />
    </dependencies>
</ivy-module>

And modified the build.xml like this:
<!-- =================================
          target: resolve             
         ================================= -->
    <target name="resolve" depends="clean, clean-cache">
        <ivy:retrieve />
    </target>

That is all.

One more thing. You can use Ivy in Eclipse. For this one can download plugin IvyDE.