ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Miller <thatguy1...@gmail.com>
Subject Re: How to exclude sources when building using Ant
Date Mon, 11 Oct 2010 14:44:23 GMT
<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" sync="true"
type="jar" conf="*"/>

Here's what I use. This task will pull all the artifacts for the most
recently called resolve command.

- This pattern says, put all my retrieved artifact files in the lib
dir, under its conf folder. So libdir/compile/commons-lang.jar for
example.
- Using sync="true", it will delete old artifacts that were retrieved
on a previous retrieve before pulling the current.
- Using type="jar", I told it to only pull the jar files, not the
sources or other types of artifacts.
- Using conf="*" which says to retrieve the artifacts for all
configurations. Using the pattern above, you would end up with several
configuration folders under the lib dir. * is the default setting, so
the conf attribute can be excluded.

After the retrieve, you are left with a bunch a folders under lib,
each which is a set of artifacts. So now in ant, it's easy to build a
classpath from the folder structure.

<classpath>
      <fileset dir="libdir">
        <include name="compile/*.jar"/>  <!-- Where compile is the
configuration with the jars needed to compile -->
      </fileset>
</classpath>

On Mon, Oct 11, 2010 at 8:38 AM, David Sills <DSills@datasourceinc.com> wrote:
> All:
>
> I have finally managed to successfully integrate at least a beginner's
> setup for Ivy into my project, after a bit of head-banging. However,
> another problem has arisen.
>
> What really helped me was that since I was using Spring, I was able to
> build the Spring codebase, which enabled me to see a real project with
> Ivy in action. That seemed to help a lot (also, a bunch of additional
> JAR files were downloaded in the process, which went immediately into my
> cache).
>
> Now I am getting the imports I need (and some I don't actually need)
> using ivy:retrieve in Ant. No objection to having the license files, but
> I really don't need the *-source-*.jar files (which are, however, in the
> cache, and it's not such a bad thing, having them).
>
> I'm not quite understanding how not to retrieve these files during my
> build. Any suggestions would be welcome.
>
> David Sills
>
>

Mime
View raw message