Ivy

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(New page: == Step by Step == <ol> <li>Download Ivy from http://ant.apache.org/ivy <li>Install following the directions, i.e. copy the ivy jars to $ANT_HOME/lib, usually something like /opt/ant/lib ...)
 
(build.xml: Make the default target valid.)
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
 
== Step by Step ==
 
== Step by Step ==
 +
 +
''[Tested with Resin 3.1.5 and Ivy 2.0]''
  
 
<ol>
 
<ol>
Line 8: Line 10:
 
<li>Create an ivysettings.xml file in my-project/ivysettings.xml (to point to the Caucho repository)
 
<li>Create an ivysettings.xml file in my-project/ivysettings.xml (to point to the Caucho repository)
 
</ol>
 
</ol>
 +
 +
The update task will download the Resin jars and their dependencies into my-project/lib.
  
 
=== build.xml ===
 
=== build.xml ===
  
 
<code><pre>
 
<code><pre>
<project name="my-project" default="compile" basedir="."
+
<project name="my-project" default="update" basedir="."
 
         xmlns:ivy="antlib:org.apache.ivy.ant">
 
         xmlns:ivy="antlib:org.apache.ivy.ant">
  
Line 20: Line 24:
  
 
</project>
 
</project>
</code></pre>
+
</pre></code>
  
 
=== ivy.xml ===
 
=== ivy.xml ===

Latest revision as of 16:07, 12 December 2008

Contents

[edit] Step by Step

[Tested with Resin 3.1.5 and Ivy 2.0]

  1. Download Ivy from http://ant.apache.org/ivy
  2. Install following the directions, i.e. copy the ivy jars to $ANT_HOME/lib, usually something like /opt/ant/lib or /usr/share/ant/lib
  3. Create a new project my-project and my-project/build.xml (see below for the build.xml)
  4. Create an ivy.xml dependencies file in my-project/ivy.xml
  5. Create an ivysettings.xml file in my-project/ivysettings.xml (to point to the Caucho repository)

The update task will download the Resin jars and their dependencies into my-project/lib.

[edit] build.xml

<project name="my-project" default="update" basedir="."
         xmlns:ivy="antlib:org.apache.ivy.ant">

  <target name="update">
    <ivy:retrieve/>
  </target>

</project>

[edit] ivy.xml

<ivy-module version="2.0">
  <info organisation="com.foo" module="test"/>

  <dependencies>
    <dependency org="com.caucho" name="resin" rev="3.1.5"/>
  </dependencies>
</ivy-module>

[edit] ivysettings.xml

<ivysettings>
  <settings defaultResolver="default"/>

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

  <resolvers>
     <url name="caucho" m2compatible="true">
      <ivy pattern="http://caucho.com/m2/com/caucho/[module]/[revision]/ivy-[revision].xml"/>
      <artifact pattern="http://caucho.com/m2/com/caucho/[module]/[revision]/[artifact]-[revision].[ext]"/>
    </url>
 
    <chain name="default" returnFirst="true">
      <resolver ref="local"/>
      <resolver ref="main"/>
      <resolver ref="caucho"/>
    </chain>
  </resolvers>
</ivysettings>
Personal tools