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

  • SEARCH
  • Home
  • 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 6468969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:56:23+00:00 2026-05-25T05:56:23+00:00

I was using ANT to deploy my stuff to Tomcat. But I had trouble

  • 0

I was using ANT to deploy my stuff to Tomcat. But I had trouble with missing dependencies and I wanted to add Ivy, cause it was reccomended.

Now I added this to my build.xml file:

<!-- Ivy settings start-->

    <condition property="ivy.home" value="${env.IVY_HOME}">
        <isset property="env.IVY_HOME" />
    </condition>


    <target name="download-ivy" unless="offline">
        <mkdir dir="${ivy.jar.dir}"/>
            <!-- download Ivy from web site so that it can be used even without any special installation -->
        <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" 
            dest="${ivy.jar.file}" usetimestamp="true"/>
    </target>


    <target name="init-ivy" depends="download-ivy">
        <!-- try to load ivy here from ivy home, in case the user has not already dropped
        it into ant's lib dir (note that the latter copy will always take precedence).
        We will not fail as long as local lib dir exists (it may be empty) and
        ivy is in at least one of ant's lib dir or the local lib dir. -->
        <path id="ivy.lib.path">
            <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
        </path>
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
        uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
    </target>

    <target name="go" depends="init-ivy" description="--> resolve dependencies, compile and run the project">
    <echo message="using ivy to resolve commons-lang 2.1..."/>
    <!--
    here comes the magic line: asks ivy to resolve a dependency on commons-lang 2.1 and to build an ant path with it from its cache
    -->
    <ivy:cachepath organisation="commons-lang" module="commons-lang" revision="2.1" pathid="lib.path.id" inline="true"/>
    </target>
<!-- Ivy settings end-->

With this I am trying to add common-lang JAR file to my project.
This is what I get as output:

    Buildfile: C:\Users\Jansu\workspace\HelloWorld\build.xml
build:
deploywar:
download-ivy:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
      [get] To: C:\Users\Jansu\.ant\lib\ivy-2.2.0.jar
      [get] Not modified - so not downloaded
init-ivy:
go:
     [echo] using ivy to resolve commons-lang 2.1...
[ivy:cachepath] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:cachepath] :: loading settings :: url = jar:file:/C:/Users/Jansu/.ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:cachepath] :: resolving dependencies :: commons-lang#commons-lang-caller;working
[ivy:cachepath]     confs: [default, master, compile, provided, runtime, system, sources, javadoc, optional]
[ivy:cachepath]     found commons-lang#commons-lang;2.1 in public
[ivy:cachepath] :: resolution report :: resolve 151ms :: artifacts dl 10ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      default     |   1   |   0   |   0   |   0   ||   1   |   0   |
    |      master      |   1   |   0   |   0   |   0   ||   1   |   0   |
    |      compile     |   1   |   0   |   0   |   0   ||   0   |   0   |
    |     provided     |   1   |   0   |   0   |   0   ||   0   |   0   |
    |      runtime     |   1   |   0   |   0   |   0   ||   0   |   0   |
    |      system      |   1   |   0   |   0   |   0   ||   0   |   0   |
    |      sources     |   1   |   0   |   0   |   0   ||   1   |   0   |
    |      javadoc     |   1   |   0   |   0   |   0   ||   1   |   0   |
    |     optional     |   1   |   0   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------
BUILD SUCCESSFUL
Total time: 2 seconds

I guess it works..
now 2 questions:

1) where do those JAR files appear in my project?

2) how would I add other JAR files, such as Spring framework files?

  • 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-25T05:56:23+00:00Added an answer on May 25, 2026 at 5:56 am

    This:

    <ivy:cachepath organisation="commons-lang" module="commons-lang" revision="2.1" pathid="lib.path.id" inline="true"/>
    </target>
    

    is called an inline retrieval and tells Ivy to build an ant-path with pathid="lib.path.id" from the ivy cache the jars will not be copied to your project. The cache is in $ {user.home}/.ivy2.

    If you want to download artifacts to your project you will have to use the retrieve task and define an ivy.xml for your project.

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

Sidebar

Related Questions

I was using ANT to deploy my stuff to Tomcat. But I had trouble
I am using ANT to deploy build in to Tomcat Server. I Want to
I deploy 3 WAR files using Ant scripts and stop and start tomcat using
I'm using ant to generate javadocs, but get this exception over and over -
When i build/deploy my php project using an ant task within eclipse, it creates
I wish to use the Tomcat install/deploy tasks from catalina-ant.jar to deploy a webapp
We have tried using ant ftp tasks, but could not get it working like
There are quite a few questions here about using ant to deploy to websphere
I was trying to deploy a WAR file using the Cargo Ant task version
Here is the scenario: We are using Linux, Tomcat stack and we deploy our

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.