Hi,

And one more option...

|ClassLoader classLoader = Lookup.getDefault().lookup(ClassLoader.class);//get global classloader try { Class<?> loadClass = classLoader.loadClass("org.netbeans.modules.settings.RecognizeInstanceObjects"); //access over java reflection } catch (ClassNotFoundException ex) { Exceptions.printStackTrace(ex); } |

​

ArSi
------------------------------------------------------------------------
*From:* Arsi <a...@chello.sk>
*Sent:* Monday, May 06, 2019 9:51PM
*To:* Users <users@netbeans.apache.org>
*Subject:* Re: NB Platform Maven Dependencies

Hi,

Each NB module has a defined list of public classes / packages, these are accessible to any other module:

|<configuration> <publicPackages> <publicPackage>nbandroid.gradle.spi.*</publicPackage> </publicPackages> </configuration> |
eg: https://github.com/NBANDROIDTEAM/NBANDROID-V2/blob/78fb8c0d57ca98bcf462b7a66523d21976fd6a24/nbandroid.gradle.spi/pom.xml


All other classes are private and can only be accessed by friend modules.
You must define it in pom.xml as:

|<configuration> <moduleDependencies> <dependency> <!--Private Package Reference--> <id>org.netbeans.api:org-netbeans-modules-settings</id> <type>impl</type> </dependency> </moduleDependencies> </configuration> |
eg: https://github.com/NBANDROIDTEAM/NBANDROID-V2/blob/78fb8c0d57ca98bcf462b7a66523d21976fd6a24/nbandroid.core/pom.xml


This will link your module to the implementation version of the module you are compiling with. If you try to install the module in NB that have a different implementation version of that module, you won't be able to install it..


I made a special installer and update server that can bypass it. But you must be sure that the definitions of the methods you use with those private classes have not changed in the newer version:

https://github.com/NBANDROIDTEAM/NBANDROID-V2-Autoupdate-plugin
https://github.com/NBANDROIDTEAM/NBANDROID-V2-Autoupdate-Web-server


And one more warning, NB Maven plugin sometimes tends to list this message if it can't find for example org.codehaus.jackson and that module is using it. It is always necessary to read properly what is in the statement and not to automatically add impl dependency.

ArSi




------------------------------------------------------------------------
*From:* Adam Korynta <a...@rmanet.com>
*Sent:* Monday, May 06, 2019 7:53PM
*To:* Netbeans Mailing List <users@netbeans.apache.org>
*Subject:* NB Platform Maven Dependencies

Hi All,

I’m trying to compile my Netbeans Platform modules using Maven, but I’m unable to compile due to the following errors:

[INFO] Private classes referenced in module: [org.netbeans.modules.settings.RecognizeInstanceObjects]

[ERROR] Project depends on packages not accessible at runtime in module org.netbeans.api:org-netbeans-modules-settings:nbm:RELEASE82

[INFO] Private classes referenced in module: [org.netbeans.modules.openide.util.ServiceProviderProcessor]

[ERROR] Project depends on packages not accessible at runtime in module org.netbeans.api:org-openide-util-lookup:nbm:RELEASE82

[INFO] Private classes referenced in module: [org.netbeans.modules.openide.filesystems.RecognizeInstanceFiles]

[ERROR] Project depends on packages not accessible at runtime in module org.netbeans.api:org-openide-filesystems:nbm:RELEASE82

These modules are declared in my pom.xml dependencies list as below:

<*dependency*><*groupId*>org.netbeans.api</*groupId*><*artifactId*>org-netbeans-modules-settings</*artifactId*><*version*>${netbeans.version}</*version*><*type*>nbm</*type*></*dependency*><*dependency*><*groupId*>org.netbeans.api</*groupId*><*artifactId*>org-openide-util-lookup</*artifactId*><*version*>${netbeans.version}</*version*><*type*>nbm</*type*></*dependency*><*dependency*><*groupId*>org.netbeans.api</*groupId*><*artifactId*>org-openide-filesystems</*artifactId*><*version*>${netbeans.version}</*version*><*type*>nbm</*type*></*dependency*>

When I look at the downloaded .jar and .nbm files, the MANIFEST.MFs’ OpenIDE-Module-Public-Packages entries do not contain the packages that are trying to be referenced. I’ve attached the org-netbeans-modules-settings-RELEASE82.jar’s MANIFEST.MF as an example. I would expect to find the “org.netbeans.modules.settings” package under the public packages listing.

If anyone could let me know what I’m doing wrong, that would be great1

Thank you,

Adam Korynta

/Resource Management Associates - Software Developer/

/1756 Picasso Avenue, Suite G, Davis, CA 95618/

/Phone 530-564-7043 ext. 217/

/Fax 530-231-5323/

/a...@rmanet.com/

/https://www.rmanet.com/

logo <https://www.rmanet.com/>


---------------------------------------------------------------------
To unsubscribe, e-mail:users-unsubscr...@netbeans.apache.org
For additional commands, e-mail:users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists







Reply via email to