Meaningless Drivel is fun!*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant task inheritRefs attribute is not working as expected Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant task inheritRefs attribute is not working as expected" Watch "Ant task inheritRefs attribute is not working as expected" New topic
Author

Ant task inheritRefs attribute is not working as expected

Mohit Jagetia
Greenhorn

Joined: Dec 06, 2004
Posts: 1


Hi,
I have a problem in downcasting the attached reference to a project (when i call the target from another build file).



- The downcasting works fine in the same ant build file.
- Also it works for simple types eg. string, int etc. but not for complex type eg. class having mixed datatype int, string or other classes



Senario:
I have a main build.xml calling target "Target2" of build2.xml using task "Ant"
All the references and properties are expected to be transfer to Target2 and should be retrieved / casted to the original types.



Details:
For the above senario i created a custom task "mainTask" which create an instance of Subq object and uses addReference() method of Project class to attach the reference of it



This attached reference is expected to pass to the Target2 of build2.xml file with following ant task



In the Target2 of build2.xml i have another custom task which prints all the references received and try to retrive the attached reference "myobj1"



I can see the reference "myobj1" in hashtable with hastable.toString() method



I check the type of the object



But when i try to cast it with Subq it throws ClassCastException







Ay Help will be greatly appreciated.
Thanks,
Corey
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant task inheritRefs attribute is not working as expected
 
Similar Threads
Fully Automate Build & Deployment Using Ant
Issue in deploying WAR file on websphere using ant
XDoclet
Canoo web testing
SQL