Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem here is that the <strong>lib</strong> tag is a custom <strong>fileset</strong> that targets it's files into the war archive's <em>lib</em> sub directory. It might be possible to write a custom <strong>war</strong> task but I don't think it's worth the effort.</p> <p>If want to improve the manner in which ivy manages your war's dependencies might I suggest using configurations?</p> <p>Create a configuration describing the run-time dependencies:</p> <pre><code> &lt;ivy-module version="2.0"&gt; &lt;info organisation="apache" module="hello-ivy"/&gt; &lt;configurations&gt; &lt;conf name="build" description="Libraries needed to for compilation"/&gt; &lt;conf name="war" extends="build" description="Libraries that should be included in the war file" /&gt; &lt;/configurations&gt; &lt;dependencies&gt; &lt;dependency org="commons-lang" name="commons-lang" rev="2.0" conf="build-&gt;*,!sources,!javadoc"/&gt; &lt;dependency org="commons-cli" name="commons-cli" rev="1.0" conf="build-&gt;*,!sources,!javadoc"/&gt; &lt;/dependencies&gt; &lt;/ivy-module&gt; </code></pre> <p>Afterwards you retrieve them into a dedicated directory (using a pattern) which can be simply included using the <strong>war</strong> task's <strong>lib</strong> tag:</p> <pre><code> &lt;ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]"/&gt; &lt;war destfile="${war.file}" webxml="${resources.dir}/web.xml"&gt; &lt;fileset dir="${resources.dir}" excludes="web.xml"/&gt; &lt;lib dir="${lib.dir}/war"/&gt; &lt;/war&gt; </code></pre> <p>The advantage of this approach is that you use the ivy <strong>conf</strong> attribute of each project dependency to ultimately decide if the jar gets included within the war file or not. The build file no longer cares.</p> <p>In conclusion I understand that the point of your post was concern for multiple copies of your jar files... Using my suggested approach will further multiple your copies, but I would submit that this is not an issue provided you have a <em>clean</em> target to remove them afterwards.</p>
    singulars
    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