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 20211 - Running Ant using different Ant version / classpath
Summary: Running Ant using different Ant version / classpath
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: API, ARCH
: 23127 (view as bug list)
Depends on: 34783 35756 36702 38306
Blocks: 34295
  Show dependency tree
 
Reported: 2002-02-06 15:20 UTC by Milan Kubec
Modified: 2004-03-04 22:33 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kubec 2002-02-06 15:20:19 UTC
Could be usefull to have a way how to execute ant scripts by different JDK than
one NetBeans is running on.
Comment 1 Jesse Glick 2002-02-07 13:01:04 UTC
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.
Comment 2 Jesse Glick 2002-05-06 04:41:42 UTC
*** Issue 23127 has been marked as a duplicate of this issue. ***
Comment 3 Jesse Glick 2002-05-06 04:42:41 UTC
Should probably be considered for some future release.
Comment 4 Jesse Glick 2003-03-10 15:35:42 UTC
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
Comment 5 Jesse Glick 2003-07-03 21:21:43 UTC
I am working on this in branch pluggable_ant_20211. Base tag
pluggable_ant_20211_base; branched ant + apisupport.
Comment 6 Jesse Glick 2003-07-04 02:52:21 UTC
Seems to be working well on the branch.
Comment 7 Jesse Glick 2003-07-04 06:08:35 UTC
IN=13957
Comment 8 Jesse Glick 2003-07-07 17:27:46 UTC
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
Comment 9 Jesse Glick 2003-07-07 18:00:28 UTC
Forgot:

nbbuild/build.xml 1.346
Comment 10 Jesse Glick 2003-07-08 16:33:32 UTC
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
Comment 11 Patrick Keegan 2004-03-04 22:33:29 UTC
removing RELNOTE keyword