Bug 199318 - Support loading a module from a directory, not just a JAR file
Support loading a module from a directory, not just a JAR file
Status: NEW
Product: platform
Classification: Unclassified
Component: Module System
7.1
All All
: P3 (vote)
: TBD
Assigned To: tomwheeler
issues@platform
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-09 17:16 UTC by tomwheeler
Modified: 2011-06-10 23:26 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


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

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:

  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.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo