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.
Could be usefull to have a way how to execute ant scripts by different JDK than one NetBeans is running on.
This would involve using external execution for Ant from NB, which involves a number of issues. Should be considered as a possible longer-term feature; not an isolated improvement.
*** Issue 23127 has been marked as a duplicate of this issue. ***
Should probably be considered for some future release.
This should be considered a critical feature and will probably be required for S1S packaging as well. I am not convinced that running in a different JDK/JVM is strictly necessary; would appreciate some concrete use cases. Using actual external execution introduces a lot of potential problems and would probably be less efficient. A different approach would permit easy changing (by the user via GUI) of both the version of Ant used; and its "classpath", which in Ant 1.x still unfortunately controls things like loadability of optional tasks using nonbundled libraries, and specification of custom factories for e.g. regexps or javac adapters, since the Ant architecture is missing a coherent model for class loading. Basic idea: - ship ant.jar and optional.jar w/ NB but do not include them in the Class-Path of modules/ant.jar, i.e. so they are not directly visible from the module - create some dir e.g. $nbhome/ant-lib/ to contain ant-$version.jar and ant-optional-$version.jar and a new ant-bridge.jar - modules/ant.jar contains some interfaces giving the basic functionality of introspection, target execution, input handlers, etc. - ant-bridge.jar implements those interfaces using direct reference to classes in ant-$version.jar - the module creates a fresh class loader loading everything from ant-lib/*.jar - it finds the impls from ant-bridge.jar using reflection and accesses them using the interfaces in modules/ant.jar - a user can then replace ant-$version.jar etc. so long as ant-bridge.jar still links without errors (i.e. so long as the core Ant architecture has not changed incompatibly) - "replace" should not mean physically replacing the file (that would break Auto Update etc.) but changing some classpath property in Ant Settings, default value ant.jar:optional.jar:ant-bridge.jar (all from $nbhome/ant-lib/) - a user can also "add to the classpath" by requesting additional JARs to be put in this loader, e.g. optional libraries - Ant loader is held via soft reference to protect against some kinds of memory leaks - JAXP is accessible to this loader and there will be impls of at least a SAX parser, a DOM parser, and an XSLT processor; but concrete impls like Xerces, Xalan, etc. will not be visible; a user can make concrete impls of such JARs visible in the Ant loader by adding them to the custom classpath - S1S on Solaris or Linux (e.g.) using native packaging can use some bundled version of ant.jar from some system location (e.g. /opt/ant/lib/ant.jar) rather than using NB's version, or can have e.g. /opt/netbeans/ant-lib/ant.jar be a symlink to the standard location - API for registering tasks is changed so that other modules can register separate JARs which will be loaded in the Ant loader and can reference both Ant and NB classes; NB-independent tasks should not be shipped this way, but rather as plain distributed JARs with no registration, so that user build scripts use normal <taskdef> with an explicit <classpath> for portability
I am working on this in branch pluggable_ant_20211. Base tag pluggable_ant_20211_base; branched ant + apisupport.
Seems to be working well on the branch.
IN=13957
committed Up-To-Date 1.79 ant/build.xml committed Up-To-Date 1.59 ant/manifest.mf committed Up-To-Date 1.5 ant/api/doc/changes/apichanges.xml committed Up-To-Date 1.2 ant/api/doc/org/apache/tools/ant/module/api/package.html committed Up-To-Date 1.2 ant/browsetask/.cvsignore committed Up-To-Date 1.2 ant/browsetask/build.xml committed Up-To-Date 1.2 ant/browsetask/manifest.mf committed Up-To-Date 1.2 ant/browsetask/src/META-INF/taskdefs.properties committed Up-To-Date 1.2 ant/browsetask/src/org/netbeans/modules/ant/browsetask/Bundle.properties committed Up-To-Date 1.2 ant/browsetask/src/org/netbeans/modules/ant/browsetask/NbBrowse.java committed Up-To-Date 1.5 ant/docs/manifest.mf committed Up-To-Date 1.7 ant/grammar/manifest.mf removed Up-To-Date 1.1 ant/release/modules/patches/org-apache-tools-ant-module/README.txt committed Up-To-Date 1.2 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/BridgeImpl.java committed Up-To-Date 1.2 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/Bundle.properties committed Up-To-Date 1.2 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/IntrospectionHelperImpl.java committed Up-To-Date 1.2 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/NbBuildLogger.java committed Up-To-Date 1.2 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/NbInputHandler.java committed Up-To-Date 1.19 ant/src/org/apache/tools/ant/module/AntSettings.java committed Up-To-Date 1.11 ant/src/org/apache/tools/ant/module/AntSettingsBeanInfo.java committed Up-To-Date 1.19 ant/src/org/apache/tools/ant/module/Bundle.properties removed Up-To-Date 1.2 ant/src/org/apache/tools/ant/module/api/AntTargetCookie.java removed Up-To-Date 1.8 ant/src/org/apache/tools/ant/module/api/DefinitionRegistry.java committed Up-To-Date 1.16 ant/src/org/apache/tools/ant/module/api/IntrospectedInfo.java committed Up-To-Date 1.2 ant/src/org/apache/tools/ant/module/bridge/AntBridge.java committed Up-To-Date 1.2 ant/src/org/apache/tools/ant/module/bridge/AuxClassLoader.java committed Up-To-Date 1.2 ant/src/org/apache/tools/ant/module/bridge/BridgeInterface.java committed Up-To-Date 1.2 ant/src/org/apache/tools/ant/module/bridge/Bundle.properties committed Up-To-Date 1.2 ant/src/org/apache/tools/ant/module/bridge/DummyBridgeImpl.java committed Up-To-Date 1.2 ant/src/org/apache/tools/ant/module/bridge/IntrospectionHelperProxy.java committed Up-To-Date 1.30 ant/src/org/apache/tools/ant/module/nodes/AntProjectNode.java committed Up-To-Date 1.35 ant/src/org/apache/tools/ant/module/nodes/AntTargetNode.java committed Up-To-Date 1.19 ant/src/org/apache/tools/ant/module/nodes/DataTypeNode.java committed Up-To-Date 1.18 ant/src/org/apache/tools/ant/module/run/Bundle.properties removed Up-To-Date 1.5 ant/src/org/apache/tools/ant/module/run/NBInputHandler.java removed Up-To-Date 1.7 ant/src/org/apache/tools/ant/module/run/NetBeansLogger.java committed Up-To-Date 1.31 ant/src/org/apache/tools/ant/module/run/TargetExecutor.java committed Up-To-Date 1.18 ant/www/index.html committed Up-To-Date 1.5 ant/www/plans/plan.xml committed Up-To-Date 1.12 apisupport/ant/build.xml committed Up-To-Date 1.11 apisupport/ant/manifest.mf committed Up-To-Date 1.2 apisupport/ant/src/META-INF/taskdefs.properties committed Up-To-Date 1.4 apisupport/ant/src/org/netbeans/modules/apisupport/ant/AntScript.xml_ committed Up-To-Date 1.3 apisupport/ant/src/org/netbeans/modules/apisupport/ant/mf-layer.xml removed Up-To-Date 1.1 apisupport/ant/src/org/netbeans/modules/apisupport/ant/nbinstaller.xml Up-To-Date 1.7 apisupport/javahelp/org/netbeans/modules/apisupport/help/modules-ant.html committed Up-To-Date 1.25 autoupdate/src/org/netbeans/modules/autoupdate/SignVerifier.java committed Up-To-Date 1.96 nbbuild/build.properties committed Up-To-Date 1.345 nbbuild/build.xml
Forgot: nbbuild/build.xml 1.346
Additional fixes: committed * Up-To-Date 1.60 ant/manifest.mf committed * Up-To-Date 1.3 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/BridgeImpl.java committed * Up-To-Date 1.17 ant/src/org/apache/tools/ant/module/api/IntrospectedInfo.java committed * Up-To-Date 1.3 ant/src/org/apache/tools/ant/module/bridge/AntBridge.java
removing RELNOTE keyword