Hi,

I'm experimenting with ways to build NetBeans Platform applications.
I'm still new to the platform.  I've been told that Maven is the way to
go [1].  That's great; I like Maven and have used it for years.
However, I'm having trouble understanding how to use (or exclude)
NetBeans Platform modules.  How does one usually do that?

Let me explain my confusion.  Consider this blog post from 2010:

  https://blogs.oracle.com/geertjan/an-xml-editor-in-3-steps-without-any-coding

In it, Geertjan describes how to add an XML Editor to your NetBeans
Platform application.  The critical steps are:

  2. Right-click the application, choose Properties, and go to the
     Libraries panel.

    - In "platform11", add a checkmark for "Favorites".

    - In "ide12", add a checkmark for "XML Text Editor" and then click
      the "Resolve" button.

Even today in NetBeans 12.4, these steps basically seem to work in the
case of an Ant-based NetBeans Platform application.  However, in the
case of a Maven-based NetBeans Platform application, the "Libraries"
panel doesn't even exist, so it seems it must be done differently.

How do you do this in the case of a Maven-based NetBeans Platform
application?  I have not yet found good documentation that describes how
to do this with Maven.  Everything I have found so far is specific to
the Ant-based scenario.  I imagine that adding or removing platform
features must not be too difficult.  What am I missing?

After some experimentation, I did discover that I can right click on the
"Dependencies" node of my Maven-based NetBeans Platform application in
the Projects window, and from there I can type the word "favorite" into
the "Query" field of the "Search" tab.  In this way I discovered that an
artifact named org.netbeans.modules:org-netbeans-modules.favorites
exists in Maven Central.  I suppose this single artifact might be what I
need for the "Favorites" feature, but who knows?  Even if that is the
case and nothing else is required, I'm still not sure how I would go
from "I read how to do this in an Ant-specific tutorial" to "I know how
to do this in the Maven case."

By the way, I notice that by default, a new Maven-based NetBeans
Platform application will declare a dependency on the artifact
org.netbeans.cluster:platform, which in turn depends on many, many other
artifacts (including
org.netbeans.modules:org-netbeans-modules.favorites).  If I DON'T want
to include one of these things (e.g., the Favorites feature), what's the
right way to remove it from my application?

Thank you for reading this far.  Hopefully I'm just missing something
obvious.

Footnotes:
[1]  
https://lists.apache.org/thread.html/r945ab924cfc641ba71bce7c50c61af299446bfbe2b7a1624b1464673%40%3Cusers.netbeans.apache.org%3E

[2]  https://leanpub.com/nbp4beginners

-- 
Chris

Attachment: signature.asc
Description: PGP signature

Reply via email to