You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "sdedic (via GitHub)" <gi...@apache.org> on 2023/12/06 16:14:32 UTC

[PR] Work better with custom exec-style goals [netbeans]

sdedic opened a new pull request, #6805:
URL: https://github.com/apache/netbeans/pull/6805

   I have realized that when you use Micronaut module's `dev mode`, with continuous rebuild/restart supported by Maven plugin, the IDE's project customizer does not work that well.
   
   First of all, it seems that when I try to work with micronaut-provided configuration change some mapping to it, a NPE is printed to the console during write:
   ```
   java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "org.netbeans.modules.maven.configurations.M2Configuration.getActivatedProfiles()" is null
   	at org.netbeans.modules.maven.configurations.M2ConfigProvider.writeAuxiliaryData(M2ConfigProvider.java:538)
   	at org.netbeans.modules.maven.configurations.M2ConfigProvider.setConfigurations(M2ConfigProvider.java:310)
   	at org.netbeans.modules.maven.customizer.CustomizerProviderImpl.writeAll(CustomizerProviderImpl.java:364)
   	at org.netbeans.modules.maven.customizer.CustomizerProviderImpl$OptionListener.actionPerformed(CustomizerProviderImpl.java:333)
   	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2$1$1.run(CustomizerDialog.java:289)
   	at org.openide.filesystems.FileUtil$2.run(FileUtil.java:420)
   ```
   This is caused by missing initialization of member variables in M2Configuration and is fixed TBD.
   
   More important is that the UI for Run is completely disabled for Micronaut. This is becuase Micronaut uses `mn:run` goal, which is not recognized as 'executable' - NB evaluates the mapping to be incompatibly customized by the user and refuse to enable the Run arguments customizer:
   ![disabled-customizer](https://github.com/apache/netbeans/assets/26788611/d2d28db4-5a47-4eb4-8e95-627e9218d56e)
   
   So I've added a way how a plugin (Micronaut support) can inform the Maven core that there's a goal that works similar to Run. This makes the customizer to be enabled.
   
   The last change is to properly map Micronaut devmode's Run parameters to goal parameters. While NB uses `exec.vmArgs` and `exec.appArgs` to configure arguments to the VM and application, and passes them in `exec.args` to the `exec:exec` plugin, the Micronaut maven plugin recognizes none of these properties. So I've changed the action mapping in Micronaut module to use `mn.vmArgs` and `vm.appArgs` as described in the plugin's documentation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1850530144

   Squashed before merge.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1846031383

   Source https://github.com/apache/maven-help-plugin/blob/master/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java#L374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1846825147

   Sadly no: goal names as "just strings", there is no semantics attached to it. 
   
   But what if some (human) introspects the given plugin, and deploy some "meta mapping" and NB picks that up? It could be plain artifact somewhere in Central...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1846026915

   > @cstamas [#6805 (comment)](https://github.com/apache/netbeans/pull/6805#issuecomment-1845167382), do tools have to know about non-standard (run) goals and their usage/config or is there a mechanism which would help to discover/map them?
   
   They def could be discovered by tools, just like https://maven.apache.org/plugins/maven-help-plugin/describe-mojo.html


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1851423342

   If no further feedback comes, I'll merge this today.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#discussion_r1418782637


##########
java/maven/apichanges.xml:
##########
@@ -83,6 +83,25 @@ is the proper place.
     <!-- ACTUAL CHANGES BEGIN HERE: -->
 
     <changes>
+        <change id="delcare-run-goals">

Review Comment:
   Typo - "declare".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1845167382

   We had a similar conversation a while ago with regards to the JavaFX plugin execution goals.  Not sure if there's somewhere we could / should make use of this there too?
   
   I wonder if we should get some upstream (Maven) input on this requirement?  There was certainly some discussion in the earlier conversation about how this sort of thing might be supported (via configuration or convention) such that IDEs could pick up some of this information automatically.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1845232477

   > I wonder if we should get some upstream (Maven) input on this requirement? There was certainly some discussion in the earlier conversation about how this sort of thing might be supported (via configuration or convention) such that IDEs could pick up some of this information automatically.
   
   The main problem here is that independently developed goals are likely to have their own properties (here, the Micronaut has no `exec.args` full commandline equivalent, and does not support working dir too !); some of the things can be overcomed by action mapping (as in this diff). SpringBoot plugin has also `run` and yet different properties that control it. Actually I shelved yet some other changes that could allow to report not only name, but also property mapping, so the (core) Maven support could determine what of the "standard" features are actually supported. But implementation would take too long, so I deferred that to later time.
   
   Re: past conversation(s) - could you pls. find a link ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic merged PR #6805:
URL: https://github.com/apache/netbeans/pull/6805


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1846855463

   Yes, this PR is just that -- except that it does not use artifacts, but NB-specific storage for the information. Low hanging fruit. I would let this to mature a bit (to see what categorization is actually useful and in what shape) before promoting to a wider ecosystem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1846576024

   I's true that NB can *discover* goals and user properties  that control the behaviour using maven model introspection , but I what is needed here is to *recognize* semantics - that a goal "executes" (in some way) the application - and which properties (jf any) serve to pass JVM / commandline arguments, main class, working dir etc. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Work better with custom exec-style goals [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #6805:
URL: https://github.com/apache/netbeans/pull/6805#issuecomment-1845949502

   @cstamas https://github.com/apache/netbeans/pull/6805#issuecomment-1845167382, do tools have to know about non-standard (run) goals and their usage/config or is there a mechanism which would help to discover them?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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