2

I'm trying to get a feel for where most people locate the Ivy lib directory in their source tree. I'm inclined to generate it right in the project root but that requires me to add it to the svn:ignore property for each and every project. I could pop it in the "out" directory (which is typically in svn:ignore already) but that doesn't seem right either as it's not something that's generated by the build (My OCD covers definitions and semantics). Any suggesions?

Sam T.
  • 497
  • 5
  • 11
  • You might want to try www.gradle.org as an alternative to ant+ivy. – Leonard Brünings Feb 01 '12 at 16:14
  • 4
    ANT+ivy is typically the only option in modernising a large existing build. Switching build technology (even to one as excellent as Gradle) is frequently not an option in large Enterprises. – Mark O'Connor Feb 02 '12 at 02:12

1 Answers1

4

I'm assuming you are using the ivy retrieve task?

By default it places files into a local directory called "lib". You can however completely customise the location using the pattern attribute:

<ivy:retrieve pattern="/home/johndoe/lib/[artifact].[ext]"/>

Alternative

If you are worried about creating temporary files in the build workspace, I'd recommend an alternative strategy of using the cachepath to manage one or more ANT paths.

<ivy:resolve/>
<ivy:cachepath pathid="compile.path" conf="compile"/>
<ivy:cachepath pathid="runtime.path" conf="runtime"/>
<ivy:cachepath pathid="test.path"    conf="test"/>
<ivy:report/>

The resolve task will analyse and download the dependencies and the report task will generate a HTML report. The various ANT paths are populated from artifacts located in the ivy cache. Each group of jars is specified using ivy configurations.

Here's some working examples:

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185