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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:05:36+00:00 2026-05-23T11:05:36+00:00

I want to use manifestclasspath Ant task. I have a very large build.xml file

  • 0

I want to use manifestclasspath Ant task. I have a very large build.xml file with a couple of imported other build files and when I run it I get this:

build.xml:1289: The following error occurred while executing this line:
build.xml:165: Property 'some.property' already set!

I am sure that this property is defined only in manifestclasspath task. Here is my code:

<manifestclasspath property="some.property" jarfile="some.jar">
    <classpath refid="some.classpath"/>
</manifestclasspath>

This code is located inside of <project>.

What am I doing wrong? Is there a way to add something like condition to set property only if it is not already set? I don’t want to use custom Ant tasks such as Ant Contrib’s if if there is other way around.

  • 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-23T11:05:37+00:00Added an answer on May 23, 2026 at 11:05 am

    Antcall opens a new project scope, but by default, all of the properties of the current project will be available in the new project. Also if you used something like =

    <antcall target="whatever">
      <param name="some.property" value="somevalue"/>
    </antcall>
    

    in the calling project then ${some.property} is also already set and won’t be overwritten, as properties once set are immutable in ant by design.
    Alternatively, you may set the inheritAll attribute to false and only “user” properties (those passed on the command-line with -Dproperty=value) will be passed to the new project.
    So, when ${some.property} ain’t no user property, then use inheritAll=”false” and you’re done.

    btw. it’s better to use a dependency between targets via depends=”…” attribute than to use antcall, because it opens a new project scope and properties set in the new project won’t get back to the calling target because it lives in another project scope..

    Following a snippet, note the difference, first without inheritAll attribute

    <project default="foo">
     <target name="foo">
      <property name="name" value="value1" />
      <antcall target="bar"/>
     </target>
    
     <target name="bar">
      <property name="name" value="value2" />
      <echo>$${name} = ${name}</echo>
     </target>
    </project>
    

    output :

    [echo] ${name} = value1
    

    second with inheritAll=false

     <project default="foo">
         <target name="foo">
          <property name="name" value="value1" />
          <antcall target="bar" inheritAll="false" />
         </target>
    
         <target name="bar">
          <property name="name" value="value2" />
          <echo>$${name} = ${name}</echo>
         </target>
        </project>
    

    output :

    [echo] ${name} = value2
    

    some rules of thumb for antcall, it’s rarely used for good reasons :
    1. it opens a new project scope (starting a new ‘ant -buildfile yourfile.xml yourtarget’)
    so it uses more memory, slowing down your build
    2. depending targets of the called target will be called also !
    3. properties don’t get passed back to the calling target

    In some cases it might be ok when calling the same ‘standalone’ target (a target that has no target it depends on) with different params for reuse. Normally macrodef or scriptdef are used for that purpose. So, think twice before using antcall which also puts superfluous complexity to your scripts, because it works against the normal flow.

    Answer to your question in the comment, using a dependency graph instead of antcall
    you have some target that holds all conditions and sets the appropriate properties which may be evaluated by targets via if and unless attributes to control the further flow

    <project default="main">
    
     <target name="some.target">
      <echo>starting..</echo>
     </target>
    
     <!-- checking requirements.. -->
     <target name="this.target">
      <condition property="windowsbuild">
       <os family="windows"/>
      </condition>
      <condition property="windowsbuild">
       <os family="unix"/>
      </condition>
      <!-- ... -->
     </target>
    
     <!-- alternatively
      <target name="yet.another.target" depends="this.target" if="unixbuild">
     -->
     <target name="another.target" depends="this.target" unless="windowsbuild">
      <!-- your unixspecific stuff goes here .. -->
     </target>
    
     <!-- alternatively
      <target name="yet.another.target" depends="this.target" if="windowsbuild">
     -->
     <target name="yet.another.target" depends="this.target" unless="unixbuild">
      <!-- your windowspecific stuff goes here .. -->
     </target>
    

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

Sidebar

Related Questions

I have a transaction log file in CSV format that I want use to
I want use $.ajax to read some infomation from xml file,here is my js
I want use $.ajax get a url string from a xml file ,then with
i want use some data from a website with web service. i have a
I have a easy select tag: <select> <option></option> <option></option> </select> Then I want use
I want to use Cython to convert multiple .pyx files into an executable package
I have class in server side and I want use method of this class
Where are the Gnulib files in Linux? I want use lib like safe-read, mbchar,
I want to use private drawable from android. for that i have downloade androi-8.jar
I want use html5's new tag to play a wav file (currently only supported

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.