The NetBeans™ platform - Directory layout
Volker Rautenberg
08 Jul 2007 (last change: 16 Jun 2017)
Abstract
This article investigates the directory layout of the NetBeans™ platform. We introduce the locations of modules and their related configuration files, the launchers and the place where module update tracking data are stored.
Introduction
The NetBeans™ platform is the central cluster of the NetBeans™ IDE as well as any NetBeans™-based application. The cluster simply is a directory with sub-directories and files inside. Instead of investigating the IDE’s platform cluster, a binary zip-archive distribution of the platform may equivalently be considered, since it has the same structure with just a small number of additional—mostly build related—files not found in the IDE. Here is a screenshot of a sample NetBeans™ IDE 6.0 installation with the relevant platform directories expanded and highlighted:
Let us walk through the directories and their contents one by one.
Directory ‘platform7’
Besides a set of sub-directories (ie config, core, docs, lib, modules, and update_tracking) the cluster’s root directory includes three files only, all of which deal with licences:
DISTRIBUTION.txt refers to the JavaHelp™ software distributed with the NetBeans™ platform, while LICENSE.txt contains NetBeans’s CDDL licence as well as the GPL licence with classpath exception. THIRDPARTYLICENSEREADME.txt embraces the LGPL licence refering to the Swing Layout Extensions integration module coming with the platform.
Directory ‘platform7/config’
Here, only the two sub-directories ModuleAutoDeps and Modules are present which both hold external metadata required by the runtime container to obtain module information beforehand:
Directory ‘platform7/config/ModuleAutoDeps’
This directory is a kind of customer care, because it contains XML configuration files related to a NetBeans™ feature called automatic module dependencies. Imagine that a large module is going to be broken down into smaller ones. Such a design decision potentially would break existing API contracts and make the trustful developers quite unhappy. Luckily, the automatic module dependency mechanism based upon config file handles the situation by transforming old dependencies into new ones just before a module is loaded by the module system. In this way, backward compatibility of modules is maintained behind the scenes. The NetBeans XML document type definition (DTD) Automatic Module Dependencies provides the necessary grammar of the files shown in the next screenshot:
Directory ‘platform7/config/Modules’
Most NetBeans™ modules are associated with runtime XML metadata (or module status configuration files) needed for module detection at runtime. These XML files are governed by the NetBeans™-specific Module Status DTD and, among others, the module type (ie regular, autoload, eager), JAR file location(s), and specification version are provided. The screenshot below only shows the topmost files:
Directory ‘platform7/core’
This directory contains the JAR files of two modules constituting the NetBeans™ runtime container:
Directory ‘platform7/docs’
The Swing Layout Extensions integration module has shortly been mentioned above: it essentially wraps the org.jdesktop.layout
Swing-layout library, the most prominent member being the GroupLayout
manager introduced with Java SE 6. The docs directory hosts two related ZIP files, containing the Javadoc™ API documentation in the one (swing-layout-1.0.3-doc.zip), the library’s sources in the other (swing-layout-1.0.3-src.zip):
Directory ‘platform7/lib’
This is the location of the three remaining constituting modules of the NetBeans™ runtime container and the NetBeans™ launchers:
File boot.jar represents module Bootstrap, org-openide.modules.jar is the Module System API and org.openide-util.jar is module Utilities API.
The launchers are: nbexec on Unix® and GNU/Linux-like operating systems and nbexec.exe on Microsoft® Windows®.
The Bootstrap module always is the first one to be loaded. And as it depends on the Module System API* as well as the Utilities API modules, the contents of this directory is quite evident. So, both directories platform7/lib and platform7/core comprise the NetBeans™ runtime container.
Directory ‘platform7/modules’
Most JAR files of the platform’s modules reside in this directory. Again, the screenshot only shows the topmost files:
Directory ‘platform7/modules/ext’
The NetBeans™ platform includes a number of JARs which are wrapped into so-called simple library modules whose purpose is just wrapping. The JARs being wrapped are deposited here:
File jh-2.0_05.jar is the JavaHelp™ system, it is wrapped by module JavaHelp Integration; script-api.jar is the Java™ scripting support wrapped by module JSR 223 Integration. File swing-layout-1.0.3.jar effectively is the binary of file swing-layout-1.0.3-src.zip already mentioned in directory platform7/docs. Finally, there is updater.jar, which is concerned with module updates and update tracking; the corresponding module is Auto Update Services.
Directory ‘platform7/update_tracking’
Each platform module may be auto-updated by a more recent version. This directory embraces update tracking XML metadata files for each module. Proper updating information includes a module’s code base name, install time, specification version, the location of the runtime module XML metadata and JAR files, and a CRC checksum. All these data are stored in DTD-less XML files shown in the next screenshot:
Copyright © 2007, 2017 by Volker Rautenberg. Some rights reserved.
Except where otherwise noted, this work is licenced to the public under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
The names of companies and products mentioned in this work may be trademarks, registered trademarks or service marks of their respective owners. Trademarks and service marks are used for referential purposes only and are not intended to infringe the rights of the mark owners.