Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3842684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:49:44+00:00 2026-05-19T15:49:44+00:00

I am building a project using Ant and Ivy. The build.xml file depends on

  • 0

I am building a project using Ant and Ivy. The build.xml file depends on ant-contrib, bean scripting framework, beanshell, and commons-logging.

Ant searches for libraries in several places, including ${user.home}/.ant/lib.

Is there any way in the build.xml file to have these libraries automatically download and install in the ${user.home}/.ant/lib directory if they are not already present, perhaps using Ivy itself?

Thanks, Ralph

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:49:45+00:00Added an answer on May 19, 2026 at 3:49 pm

    I happened on this question as I was reading the Ivy cachefileset documentation, which states:

    Please prefer the use of retrieve +
    standard ant path creation, which make
    your build more independent from ivy
    (once artifacts are properly
    retrieved, ivy is not required any
    more).

    The Ivy cachepath documentation similarly states:

    If you want to make your build more
    independent from Ivy, you could
    consider using the retrieve task. Once
    the artifacts are properly retrieved,
    you can use standard Ant path creation
    which makes Ivy not necessary any
    more.

    So, it would seem a better answer would be to modify Mark’s response to something that uses retrieve in conjunction with ant paths. Something along the lines of the following:


    Mark’s Response (modified)

    <configurations>
      <conf name="tasks" description="Ant tasks"/>
    </configurations>
    
    <dependencies>
      <dependency org="ant-contrib" name="cpptasks" rev="1.0b5"
          conf="tasks->default"/>
      <dependency org="junit" name="junit" rev="3.8" conf="tasks->default"/>
      ..
    

    In your build.xml file you can create a path from this config

    <ivy:retrieve conf="tasks"
         pattern="${dir.where.you.want.taskdef.jars}/[artifact]-[revision].[ext] />
    
    <path id="tasks.path">
      <fileset dir="${dir.where.you.want.taskdef.jars}">
        <include name="**/*.jar"/>
      </fileset>
    </path>
    
    <taskdef name="task1" classname="??" classpathref="tasks.path"/>
    <taskdef name="task2" classname="??" classpathref="tasks.path"/>
    

    This would even allow you to move the retrieve task into a separate ant file that deals with dependencies. Thereby, you don’t have to rely on ivy after your dependencies are retrieved into their directories.

    The intention of ivy is that you use it to pull down your jars (resolve & retrieve). Once you have them in place, you can switch back to using standard Ant.


    Note: I would just pull these dependencies into the lib directory. That would simplify the retrieve task:

    <ivy:retrieve conf="tasks" />
    

    Also Note: visit the ‘Path-like Structures’ section of this page for more on “standard ant path creation”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I build flex project using ant, the resultant .SWF file size is 329
I'm currently using ANT for building my Java project on a Windows XP machine.
I'm currently using ant for building my java project on a Windows XP machine.
I am building a project using Maven. In the Pom.xml i have added dependency
I am trying to build and run an android project using the phonegap framework.
I am using Ant > 1.8 + Proguard 4.6 to build my Android project
I am using ant for building my projects, This project needs more memory then
I configured my android project to use ant. When building using the keyword release
I'm building a project using a GNU tool chain and everything works fine until
I am building a project using Visual Studio. The project has a dependency on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.