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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:04:47+00:00 2026-05-30T01:04:47+00:00

Is it possible to execute an apply on a file set and have ant

  • 0

Is it possible to execute an apply on a file set and have ant print the command it is executing?

For example:

<target name="test">
    <apply executable="ls" failonerror="true" verbose="true" ignoremissing="false">
        <fileset dir=".">
            <include name="*.xml" />
        </fileset>

        <arg line="-la" />
    </apply>
</target>

I would like the output to be something close to the following, with the key line being:

[apply] ls -la ./build.xml"

E.g.

Buildfile: /home/abarker/NetBeansProjects/TestProject/build.xml
test:
    [apply] ls -la ./build.xml
    [apply] -rw-r--r-- 1 abarker abarker 29231 Feb 13 11:29 /home/abarker/NetBeansProjects/TestProject/build.xml
    [apply] Applied ls to 1 file and 0 directories.
  • 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-30T01:04:49+00:00Added an answer on May 30, 2026 at 1:04 am

    There are several ideas I have:

    • You can use the outputproperty parameter. This will give you the output of the command in the <apply> task.

    • You can use fileset reference instead of an actual fileset.

    Like this:

    <property name="apply.files.prop" refid='apply.files'/>
    <echo>The files you're operating on are "${apply.files.prop}"</echo>
    
    <apply executable="ls" failonerror="true" verbose="true" ignoremissing="false">
        <fileset refid="apply.files"/>
        <arg line="-la" />
    </apply>
    

    You can then look at the fileset reference apply.files to see what files the <apply> task is operating on.

    You can always add the -debug and -verbose flag when you run ant. This will print exactly what you want and then some — then some a whole lot. I wish there was a way to turn verbose mode on and off on a particular task, but I don’t know how to do that — at least an easy way to do that.

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

Sidebar

Related Questions

Does it possible to execute php file and store its output into some variable?
Is it possible to execute a specific sub in a vbs file from a
How is it possible to execute a direct SQL command to an ADO.NET connected
Is it possible to execute any git command in silent mode? For instance, can
Is it possible to extract a functions caller scope? I have this example: var
Is it possible to execute string path on dynamic type? For example having dynamic
Is it possible to execute python command in admin panel or in django view?I.
Is it possible to execute .htaccess file on Tomcat? We are trying to get
Is it possible to execute Apache Ant build tool in a validation ode? e.g
Possible Duplicate: Javascript infamous Loop problem? I have the following: function test(a,b,c){ console.log(a+b+c); }

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.