'Ant property keys not working as expected

I have defined external property file with below keys

  fruit.taste.mango=sweet
  fruit.taste.orange=sore

I want to form above key dynamically but its not working

<project name="Flavor" default="Init">
 <taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" />
<property file="build.properties"/>
<target name="Init">
  
    <foreach param="fruit" list="mango,orange" target="fruitTaste"/>
</target>
<target name="fruitTaste">
    <echo message="Taste of fruit  ${fruit} is ...."/>
    <echo>${fruit.taste.${fruit}} </echo>
</target>
</project>

here is the output

    [echo] Taste of fruit  orange is ....
    [echo] ${fruit.taste.${fruit}}

why the keys are not getting replaced to values ?

ant


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source