-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work better with custom exec-style goals #6805
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change makes sense to me + code looks good on first glance. Haven't tested it yet but I hope to have some time this weekend.
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. |
The main problem here is that independently developed goals are likely to have their own properties (here, the Micronaut has no Re: past conversation(s) - could you pls. find a link ? |
@cstamas #6805 (comment), 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 |
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. Is there such semantic categorization in |
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... |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
5116d6a
to
757cff1
Compare
Squashed before merge. |
If no further feedback comes, I'll merge this today. |
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:
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: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
andexec.appArgs
to configure arguments to the VM and application, and passes them inexec.args
to theexec:exec
plugin, the Micronaut maven plugin recognizes none of these properties. So I've changed the action mapping in Micronaut module to usemn.vmArgs
andvm.appArgs
as described in the plugin's documentation.