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.

Bug 199927

Summary: Impossible to recognize build.xml as text/x-ant+xml
Product: projects Reporter: Jesse Glick <jglick>
Component: AntAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: normal Keywords: API
Priority: P3    
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 18910, 142760    
Bug Blocks: 141355    

Description Jesse Glick 2011-07-06 20:39:27 UTC
As discussed in bug #43871, it would be nice for any build.xml to be recognized as an Ant script, even if empty (so that XML sniffing cannot yet work).

Your obvious thought would be to extend ant-mime-resolver.xml to do this. But the DTD only allows matching on file extension, not full name. Bug #18910 discusses the arbitrariness of the declarative resolver syntax, though I think it does not specifically mention this limitation.

Even if you define a MIMEResolver (registered with @ServiceProvider) which makes this check, it is never called; due to the fix of bug #141355, the declarative resolver for *.xml is called first and claims it.

Used to be partially worked around by making AntProjectDataLoader treat all build.xml as an AntProjectDataObject, so it gets the right node (even though other features keyed off MIME type like the Navigator would not work), but I am dropping APDL in favor of DataLoaderPool.factory.
Comment 1 Quality Engineering 2011-07-07 14:02:56 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/9a4336f43c38
User: Jesse Glick <jglick@netbeans.org>
Log: Using standard DataLoaderPool.factory rather than a programmatic DataLoader.
(Minor functional regression #199927: cannot recognize empty build.xml.)
Comment 2 Jaroslav Tulach 2011-07-29 12:10:21 UTC
Sounds like an enhancement for additional DTD format. Feel free to donate patch.
Comment 3 Jesse Glick 2012-01-12 00:39:42 UTC
Actually it seems this case is possible now.
Comment 4 Jesse Glick 2012-01-12 00:40:20 UTC
core-main #e33b14dc3ef0
Comment 5 Quality Engineering 2012-01-13 21:52:14 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/e33b14dc3ef0
User: Jesse Glick <jglick@netbeans.org>
Log: #199927: Impossible to recognize build.xml as text/x-ant+xml