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

Summary: Support loading a module from a directory, not just a JAR file
Product: platform Reporter: tomwheeler <tomwheeler>
Component: Module SystemAssignee: Tomas Hurka <thurka>
Status: NEW ---    
Severity: normal CC: jtulach
Priority: P3    
Version: 7.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: patch (incomplete)

Description tomwheeler 2011-06-09 17:16:24 UTC
As described in this article:

  http://netbeans.dzone.com/using-maven-and-intellij-idea

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/manifest.mf 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:
StandardModule.java: 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.