I’m again for making the stuff public. Web is working well for years now w/o 
big issues. So why not? The friends API is not that holy grail. If we are 
standing behind the code, we should change it. Just scaring About Nothing, 
because I will be responsive for my Plugin if it is not working.

If you add your plugin as a friend today, it is possible that it will not work 
tomorrow, if we remove the friend or if you change the name of your plugin 
(identification). Geertjan started a plugin yaers ago for adding Kendo UI to 
NetBeans, but it is not possible to build it anymore: 
https://github.com/GeertjanWielenga/KendoNetBeans/issues/3. Changing a public 
API back to private will not make sense and if we change them or make them 
deprecated, then there will be an alternative.

 There was a discussion to let them as they are and make a public layer which 
proxies the stuff to the outside, just as an information.

For your problem with the ExternalExecutable there is a public equivalent for 
that to use: org.netbeans.api.extexecution.base.ProcessBuilder; 

Also this is just my experience from the last years of creating NetBeans 
plugins. Atm a lots are on hold due to lack of time to dig deep into the API to 
make them public.


Cheers

Chris

Von: Eric Bresie
Gesendet: Sonntag, 31. Oktober 2021 16:48
An: Netbeans Developer List
Betreff: Graduating Friend APIs to Public APIs (Web Commons)

While working on a new python module (since I've seen little progress on
python donation completion and trying to make an LSP based version) , I
borrowed code from another language support (javascript/node js) to model
som of the functionality after which had dependencies like

import org.netbeans.modules.web.common.api.Version;
import org.netbeans.modules.web.common.ui.api.ExternalExecutable;


When attempting to build in the final steps (building the nbm) I
encountered a build issue like the following (for full trace see end of
email):

Failed to execute goal
org.apache.netbeans.utilities:nbm-maven-plugin:4.6:manifest
(default-manifest) on project python: Module has friend dependency on
org.netbeans.modules.web.common.ui but is not listed as a friend. -> [Help
1]


My assumption is my module is not a "friend" to the web.common and/pr
web.common.ui related packages which is preventing that from finishing up.

While discussing on stack, it was suggested maybe making the Web.Commons
packages "public" instead of requiring to update with all the "friends" may
be a better option.

I found
https://cwiki.apache.org/confluence/display/NETBEANS/Public+vs+Friend+API
which seems to imply after a time it may be worth making things public
(i.e. if there are more than 5 friends, the API is stable and not changing
a lot, etc.)

So with that in mind and the fact that there appears to be a lot of friends
on these packages, is it worth changing the web.common/web.common.ui to be
a public API?

If so, what is the process by which this is normally done (i.e. change from
friend to public, any API documentation updates, any build changes,
regression testing, etc.)?

Eric Bresie
ebre...@gmail.com

Full stack trace:

Failed to execute goal
org.apache.netbeans.utilities:nbm-maven-plugin:4.6:manifest
(default-manifest) on project python: Module has friend dependency on
org.netbeans.modules.web.common.ui but is not listed as a friend. -> [Help
1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.apache.netbeans.utilities:nbm-maven-plugin:4.6:manifest
(default-manifest) on project python: Module has friend dependency on
org.netbeans.modules.web.common.ui but is not listed as a friend.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
    at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
    at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
    at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch
(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoFailureException: Module has friend
dependency on org.netbeans.modules.web.common.ui but is not listed as a
friend.
    at
org.apache.netbeans.nbm.NetBeansManifestUpdateMojo.visibleModuleClasses
(NetBeansManifestUpdateMojo.java:900)
    at
org.apache.netbeans.nbm.NetBeansManifestUpdateMojo.checkModuleClassPath
(NetBeansManifestUpdateMojo.java:717)
    at org.apache.netbeans.nbm.NetBeansManifestUpdateMojo.execute
(NetBeansManifestUpdateMojo.java:561)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
    at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
    at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
    at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch
(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:347)


For more information about the errors and possible solutions, please read
the following articles:
[Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Reply via email to