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.
Created attachment 158414 [details] Small example We are porting our application from NetBeans Platform 7.4 to 8.1. We use Jython inside Ant Scripts and we need it to access the classes inside our modules. In NB7.4 this was achieved extending the Ant ClassPath via this XML text inside the layer.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd"> <filesystem> <folder name="Services"> <folder name="Hidden"> <file name="module8-antlibrary.instance"> <attr name="SystemFileSystem.localizingBundle" stringvalue="com.streamsim.geomodel.Bundle"/> <attr name="instanceCreate" methodvalue="org.apache.tools.ant.module.spi.AutomaticExtraClasspath.url"/> <attr name="url" urlvalue="nbinst://module8/modules/module8.jar"/> <attr name="instanceOf" stringvalue="org.apache.tools.ant.module.spi.AutomaticExtraClasspathProvider"/> </file> </folder> </folder> </filesystem> Unfortunately this does NOT work anymore in NB81; I tried the @ServiceLocator but it throws exception about the same class loaded by two different ClassLoaders. I made a small example, if you run it on NB74, you will see module8.jar in the ClassPath, if you run it on NB81, you won't . Thanks
Sorry I am rising to P1 because this is totally blocking our release of the application.
The purpose of AutomaticExtraClasspathProvider is to set the classpath for the executed ant tasks loader and the java system property java.class.path should not be touched by the ant execution. It was set merely as a workaround for issue #46171 and that behavior was removed because it became obsolete, caused other problems (issue #251501), and eventually could cause more problems in the future. that AECP is still working as expected can be checked in your sample by creating some class in module8 and by extending the script generated in .runMe() with something like: wr.write("<available classname=\"module8.SomeClass\" property=\"class.present\"/>\n"); wr.write("<echo message=\"${class.present}\" />\n");