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 9238753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:50:06+00:00 2026-06-18T07:50:06+00:00

i have this ant build.xml file with 3 targets in it: target1 , target2

  • 0

i have this ant build.xml file with 3 targets in it:

target1, target2 and target3.

If the user simply runs ant and not an explicit ant target1 or something like that, i want to prompt the user asking which target he would like to call.

Remember, the user should only be prompted for this only if he doesnt explicitly call a target while running ant

  • 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-06-18T07:50:07+00:00Added an answer on June 18, 2026 at 7:50 am

    you may use the input task provided by ant and make it your default target.

    <input
    message="Please enter Target ID (1,2 or 3):"
    validargs="1,2,3"
    addproperty="targetID"
    />
    

    Use the value of this property to decide which target to execute.

    From the ant documentation:

    message : The Message which gets displayed to the user during the build run.

    validargs: Comma separated String containing valid input arguments. If set, input task will reject any input not defined here.
    You may pass any arguments according to your needs.

    addproperty : The name of a property to be created from input.Behaviour is equal to property task which means that existing
    properties cannot be overridden.

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

Sidebar

Related Questions

I am converting ant to maven2. In build.xml, I have: <target name=clean> <delete file=${dir.dist}/${api.jarfile}
We have a Java application and a supporting Ant build.xml file, and the team
So I have this target in my ant build file: <target name=migrate description=Migrate the
I have the following Ant buildfile importer.xml : <project name=importer basedir=.. default=build> <import file=imported.xml/>
I have three targets in build.xml. There are not errors in process. First two
I have the following ant file that is not running the targets prepForDeployment and
I have an ant build.xml file with XJC task definition: <taskdef name=xjc classname=com.sun.tools.xjc.XJCTask> <classpath>
I have these (sample) lines in a HTML-file: test.ABC.test test.ABCD.test test.ABCE.test And this Ant
I've written an Ant build.xml file which obtains a number of source files via
I have an android project with multiple build targets (using ant). For testing purposes,

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.