Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some open source modules include optional java doc jars. To remove them add a configuration mapping to each of your dependencies:</p> <pre><code> &lt;dependency org="junit" name="junit" rev="4.8.2" conf="default"/&gt; </code></pre> <p>The <strong>default</strong> configuration in ivy is equivalent to the the <strong>compile</strong> scope in a maven module. This is how the optional libraries can be automatically omitted. (Check their POMs).</p> <p>A better approach is to declare your own configurations and the default mapping as follows:</p> <pre><code>&lt;configurations defaultconfmapping="compile-&gt;default"&gt; &lt;conf name="compile" description="Required to compile code"/&gt; &lt;conf name="test" description="Additional test dependencies" extends="compile" /&gt; &lt;/configurations&gt; </code></pre> <p>Then in your ivy file you only need to declare the non-standard configurations:</p> <pre><code>&lt;dependencies&gt; &lt;dependency org="org.hamcrest" name="hamcrest-library" rev="1.3.RC2" conf="test-&gt;default"/&gt; &lt;dependency org="junit" name="junit" rev="4.8.2" conf="test-&gt;default"/&gt; &lt;dependency org="org.mockito" name="mockito-core" rev="1.8.5" conf="test-&gt;default"/&gt; &lt;dependency org="javax.persistence" name="persistence-api" rev="1.0"/&gt; &lt;/dependencies&gt; </code></pre> <p>In this case we only want the 3 test libraries to appear on the <strong>test</strong> configuration.</p> <p>Still confused? The magic of ivy configurations is when you use them to manage your build's class path</p> <pre><code> &lt;target name='dependencies' description='Resolve project dependencies and set classpaths'&gt; &lt;ivy:resolve/&gt; &lt;ivy:cachepath pathid="compile.path" conf="compile"/&gt; &lt;ivy:cachepath pathid="test.path" conf="test"/&gt; &lt;/target&gt; </code></pre> <p>This is what Maven is doing when you declare a <em>scope</em> tag on a dependency, for example:</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;junit&lt;/groupId&gt; &lt;artifactId&gt;junit&lt;/artifactId&gt; &lt;version&gt;4.8.2&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; </code></pre> <p>The scopes in Maven are fixed. In ivy you can have as many as you need.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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