Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A multi-module project is described in the documentation:</p> <p><a href="http://ant.apache.org/ivy/history/latest-milestone/tutorial/multiproject.html" rel="nofollow">http://ant.apache.org/ivy/history/latest-milestone/tutorial/multiproject.html</a> </p> <p>and the source code is available in subversion:</p> <p><a href="http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/example/multi-project/" rel="nofollow">http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/example/multi-project/</a> </p> <p>The simplified summary of how it works:</p> <h2>Wrapper build</h2> <p>Invokes each individual module build in the correct order. If Module A depends on module B, then B will be built first:</p> <pre><code>&lt;project xmlns:ivy="antlib:org.apache.ivy.ant" name="build-all" default="build"&gt; &lt;!-- ========================================================================== Use the ivy buildlist task to create an ordered list of sub-project builds ========================================================================== --&gt; &lt;target name="build-list"&gt; &lt;ivy:buildlist reference="build-path"&gt; &lt;fileset dir="." includes="modules/**/build.xml"/&gt; &lt;/ivy:buildlist&gt; &lt;/target&gt; &lt;!-- ============================== Invoke targets in sub-projects ============================== --&gt; &lt;target name="build" depends="build-list" description="Invoke build target on sub-projects"&gt; &lt;subant target="build" buildpathref="build-path" /&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p>For more information see the <a href="http://ant.apache.org/ivy/history/latest-milestone/use/buildlist.html" rel="nofollow">buildlist</a> documentation.</p> <h2>Module build</h2> <p>Each module will download it's dependencies at the beginning of it's build</p> <pre><code>&lt;target name="init"&gt; &lt;ivy:settings file="../../ivysettings.xml"/&gt; &lt;ivy:resolve/&gt; &lt;/target&gt; </code></pre> <p>At at the end, will publish it's built artifacts:</p> <pre><code>&lt;target name="publish" depends="build" description="Publish module artifacts to the respository"&gt; &lt;ivy:publish resolver="${publish.resolver}" pubrevision="${publish.revision}" overwrite="true"&gt; &lt;artifacts pattern="${build.dir}/[artifact].[ext]"/&gt; &lt;/ivy:publish&gt; &lt;/target&gt; </code></pre> <p>Don't forget that for all this to work each module must declare what it depends on and what it publishes</p> <pre><code>&lt;ivy-module version='2.0'&gt; &lt;info organisation='com.myorg' module='mymod'/&gt; &lt;publications&gt; &lt;artifact name="mymod" type="jar"/&gt; &lt;/publications&gt; &lt;dependencies&gt; .. &lt;/dependencies&gt; &lt;/ivy-module&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload