目录

我的学习分享

记录精彩的程序人生

【Netbeans Platform】Minimal NetBeans Platform Dependencies

minimaldepsmvnnb1.png

When you have no more than this dependency in the application module of your NetBeans Platform application, you have all you need for the simplest imaginable NetBeans Platform application.

<dependencies>   
    <dependency>
        <groupId>org.netbeans.modules</groupId>
        <artifactId>org-netbeans-core-startup</artifactId>
        <version>${netbeans.version}</version>
        <type>jar</type>
    </dependency>
</dependencies>

The above results in one direct dependency (i.e., the first node below, which has a lightblue icon, meaning a direct dependency), together with 5 transitive dependencies (with grey icons below):

minimaldepsmvnnb1.png

That starts up the NetBeans Platform, provides no user interface (except a splash screen, which you can supress via -nosplash), and thus lets you create command line tools on the NetBeans Platform.

For a GUI application, add two other direct dependencies, shown below:

<dependencies>   
    <dependency>
        <groupId>org.netbeans.modules</groupId>
        <artifactId>org-netbeans-core-startup</artifactId>
        <version>${netbeans.version}</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>org.netbeans.modules</groupId>
        <artifactId>org-netbeans-core-windows</artifactId>
        <version>${netbeans.version}</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>org.netbeans.modules</groupId>
        <artifactId>org-netbeans-core-ui</artifactId>
        <version>${netbeans.version}</version>
        <type>jar</type>
    </dependency>
</dependencies>

That pulls in a bunch of transitive dependencies, shown below:

minimaldepsmvnnb2.png

Now, when you run the NetBeans Platform application, you see the main window, menubar, toolbar, etc.

That means that the answer to the question "what is the minimum number of dependencies for a GUI application on the NetBeans Platform?" is: 30.


https://blogs.oracle.com/geertjan/minimal-netbeans-platform-dependencies