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.
If you attempt to create a new project with an existing ant script, the wizard rejects valid build files, with the message "The chosen build script is not a valid Ant script". Apart from being wrong (it is a valid Ant script) it is also very unhelpful, since it gives no indication what it has an issue with. Curiously, it seems to have parsed the script in the first place, because it correctly pulls out and displays the project name. This is in the 28July2004 nightly build.
can you attach the build.xml?
-> P2, not dataloss
Works OK for me in the current trunk. Have made some changes recently which I think were not in the dev build you mention. No example build script or other steps to reproduce attached, so can only guess what problem you were actually running into. Note that scripts with no 'default' or 'basedir' attr will in general not be treated by the IDE as Ant scripts (though you can use them in this wizard) because <project> (perhaps with 'name') is not distinctive enough to be identified as an Ant script rather than something else. XML files with a namespaced root element named {antlib:org.apache.tools.ant}project will however always be treated as Ant scripts. Regardless of what the wizard prompts you, as a workaround you can always edit the generated project.xml to use whatever you please.
Created attachment 16569 [details] a build file that demonstrates the problem
Ah, the line <import file="${tools.dir}/../build/build-common.xml"/> is responsible.
*** This issue has been marked as a duplicate of 45066 ***
Yes the use of "import" was the reason that the build script was being rejected. I haven't tried todays build but based on Jesse's comments suspect that there are still several problems: 1) Handling of import 2) The IDE rejects files but doesn't explain why. 3) If you correct the build file (remove the import) and try reselecting it in the wizard, the wizard does not refresh - i.e. still rejects it. You need to copy it to a new file name and select it. 4) basedir attribute should not be required - it is optional for Ant.
First of all, I have not yet committed the fix for #45066. Second, for any other problems please file fresh individual issues with steps to reproduce. Re. handling of import - what about it? See discussion in #45066. Re. the IDE rejects files but doesn't explain why - when #45066 is fixed it will not reject any well-formed XML file. Re. wizard does not refresh - applies only to that which was fixed several days ago, AFAIK. Re. basedir attribute should not be required - sorry, but the designers of Ant failed to force it to be qualified with a namespace, so an interactive environment that can display any kind of XML file has to look for something distinctive, or it would miscategorize Maven project files etc. As mentioned elsewhere, an XML file not recognized as an Ant script can still be used in a freeform project, but not edited/displayed specifically as an Ant script. Not much more can be done AFAIK. *** This issue has been marked as a duplicate of 45066 ***
closed
See issue #62752: computed filenames in <import> now supported for many common cases. (Not yet <property env="..."> however.)