This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When you run e.g. myapp, you can see warnings: ---%<--- init-macrodef-javac: Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/1:javac init-macrodef-junit: init-macrodef-nbjpda: Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/1:nbjpdastart init-macrodef-debug: Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/1:debug init-macrodef-java: Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/1:java ---%<--- Apparently the macrodef "task" definitions are inherited in mylib. 1. Produces ugly warnings. 2. If mylib has different macrodefs (e.g. uses an explicit platform where myapp does not, or vice-versa... I know this is a weird use case), what happens? Should be investigated. Perhaps file a bug for Ant - <ant inheritall="false"/> ought to not pass along macrodefs IMHO. inheritrefs="false" doesn't help either.
Created attachment 14995 [details] example (ZIP file)
Fortunately, everything works as expected on Ant 1.6.1. Attached is ZIP file with two build scripts both defining macro with the same name and namespace and main script calls the second one. The output is: D:\temp\ant_macro>ant -f main.xml Buildfile: main.xml init: all: [echo] MAIN: This must be myecho from MAIN.xml init: Trying to override old definition of task http://www.netbeans.org/ns/myecho/1:myecho all: [echo] SUB: This must be myecho from SUB.xml [echo] MAIN: This must be myecho from MAIN.xml - second try init: Trying to override old definition of task http://www.netbeans.org/ns/myecho/1:myecho all: [echo] SUB: This must be myecho from SUB.xml [echo] MAIN: This must be myecho from MAIN.xml - third try BUILD SUCCESSFUL
OK. I guess we just ignore the warnings. (Maybe can filter them out using special Ant loggers.) Thanks for investigating.