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.
The filename giving in an ant <import> statment does not respect the value set in basedir. But NB does! This leads to a situation where either NB or ANT can evaluate the build.xml correctly, but not both :( Consider this build.xml: <?xml version="1.0" encoding="UTF-8"?> <project name="changeme" default="all" basedir="imports"> <import file="imports/imptargets.xml"/> <target name="all" depends="imported"> </target> </project> This works for ant, bc. the 'imports' value of ${basedir} is not evaluate in <import>, so the filename of the file to be imported has to be given completely. But the imported targets are not displayed in the NB buildfile GUI. Changing it to <project name="changeme" default="all" basedir="imports"> <import file="imptargets.xml"/> <target name="all" depends="imported"> </target> </project> Makes the NB-ant-GUI happy, but that file does not work any more: ...\test\build.xml:3: Cannot find imptargets.xml imported from ...\test\build.xml
<project name="changeme" default="all" basedir="imports"> <import file="${basedir}/imptargets.xml"/> <target name="all" depends="imported"> </target> </project> This version works for ANT and is OK for NB, just the imported targets are not shown.
Well of course you should do what is correct for Ant, not for the IDE. I wonder if the Ant behavior here is intentional or not. I will try to find out before changing the IDE behavior. Prefer to set basedir="." if possible, it is generally clearer anyway.
*** Issue 50675 has been marked as a duplicate of this issue. ***
I will fix NB's behavior to match Ant's. But beware that the docs for <import> currently say: Important: we have not finalized how relative file references will be resolved in deep/complex build hierarchies - such as what happens when an imported file imports another file. Use absolute references for enhanced build file stability, especially in the imported files.
committed * Up-To-Date 1.5 ant/src/org/apache/tools/ant/module/api/support/TargetLister.java committed * Up-To-Date 1.2 ant/test/unit/data/targetlister/importing4.xml committed * Up-To-Date 1.2 ant/test/unit/src/org/apache/tools/ant/module/api/support/TargetListerTest.java
This issue was solved long time ago. Because nobody has reopened it neither added comments, we are verifying/closing it now. If you are still able to reproduce the problem, please reopen. Thanks in advance.