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 199318 - Support loading a module from a directory, not just a JAR file
Summary: Support loading a module from a directory, not just a JAR file
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Hurka
Depends on:
Reported: 2011-06-09 17:16 UTC by tomwheeler
Modified: 2015-01-29 19:14 UTC (History)
1 user (show)

See Also:
Exception Reporter:

patch (incomplete) (2.60 KB, application/octet-stream)
2011-06-10 23:26 UTC, tomwheeler

Note You need to log in before you can comment on or make changes to this bug.
Description tomwheeler 2011-06-09 17:16:24 UTC
As described in this article:

It would be helpful for platform developers (especially when using IntelliJ or Eclipse IDE) to run a platform application in which modules are directory structures (corresponding to an extracted JAR file), rather than a JAR file itself.  This would help to reduce turnaround times between making a change in a platform application and seeing that change when the program finally runs (since a developer could compile class files and launch the application without using Ant, for typical modifications).  

I did some experimentation which indicated that the only obstacle seemed to be org.netbeans.ModuleInstaller's loadManifest method, which assumes a module's manifest exist within a JAR file.  I was able to make a simple modification to handle the case where the "JAR" is actually a directory, and then loads the manifest from the META-INF/ below that.

If you agree with this approach, let me know and I will create a patch which includes this modification, plus a test case and documentation.  If not, I'd appreciate if you could describe a better alternative approach.
Comment 1 Jaroslav Tulach 2011-06-10 16:43:59 UTC
I know there is JarClassLoader.DirSource, so the system is capable to load classes from a directory. Also there is a way to specify patches for each module: System.getProperty("netbeans.patches." + getCodeNameBase())
possibly this property could point not only to a JAR but also to a directory...

Anyway, if you want to make classloading work, go on. Just make sure subsequent starts with caches don't touch any new files on disk.
Comment 2 tomwheeler 2011-06-10 23:26:40 UTC
Created attachment 108851 [details]
patch (incomplete)

I am attaching a tentative patch. It's untested and contains no documentation, so it's not ready to be applied, just making sure I can pick up where I left off from another machine when I work on it again.