I don't think this would work very well for multiple reasons.

It starts with the fact that default goals don't have to run a project, so 
mapping it to the run action per default is a bit questionable. The default 
goal typically builds the project. (I think you can also build NB just by 
typing 'ant')

Next problem is that by not knowing what exactly the default goal does, it 
would also not be possible to do anything outside of running that goal. Program 
args options etc would be all disabled since those are plugin specific.

(this is actually already the case when you overwrite the default run action).

So as minimal viable feature the IDE would have to scan that goal, try to 
figure out what it does and what plugins it uses, map it to the right action 
and finally figure out if the options UI can be still used for that goal 
combination.

Then there are questions what should happen with run-single, debug etc. The pom 
would have to define many other default goals with the added metadata so that 
it can be mapped to IDE actions.

Right now this config resides outside the pom in optional nbactions.xml

e.g:

<?xml version="1.0" encoding="UTF-8"?>
<actions>
    <action>
        <actionName>run</actionName>
        <goals>
            <goal>javafx:run</goal>
        </goals>
    </action>
   <!-- will need one for debug etc too -->
</actions>

would map the run action to javafx:run




We could potentially add a global default action preset as Neil mentioned 
(users can define custom actions too but maven actions without goals 
automatically turn themself off atm which would have to be changed first).

-mbien


On 3/16/25 21:55, Kenneth Fogel wrote:
> Just to be clear that I understand how NetBeans is working. When a Maven 
> based project is executed with one of the two run commands that are not in 
> the Run Maven submenu, there is a goal set by NetBeans, likely exec:java or 
> exec:exec? This will explain why my <defaultGoal> is ignored as using a goal 
> on the mvn command line overrides <defaultGoal>. In the Run Maven submenu 
> when I use the Other goals choice, leaving this dialog blank will use the 
> <defaultGoal>.
> 
> If this is so, then I implore you to please provide a way to override this 
> and use the <defaultGoal> from the pom file for the simple Run commands. This 
> is important, in my opinion, to ensure that a Maven project behaves the same 
> in NetBeans as it would from the command line or in other IDEs.
> 
> Ken
> 
> PS: Pretty please . . .
> 
> 
> -----Original Message-----
> From: Neil C Smith <neilcsm...@apache.org>
> Sent: March 14, 2025 5:52 AM
> To: dev@netbeans.apache.org
> Cc: Kenneth Fogel <kfo...@dawsoncollege.qc.ca>
> Subject: Re: Run Maven / Maven Run
> 
> On Thu, 13 Mar 2025 at 20:02, Kenneth Fogel <kfo...@dawsoncollege.qc.ca> 
> wrote:
>> Here is the github link to a very trivial project:
>> https://gith/
>> ub.com%2Fomniprof%2Fjavafx_01_basicexample.git&data=05%7C02%7Ckfogel%4
>> 0dawsoncollege.qc.ca%7Cef14dd769f89495b326808dd62dde13e%7Cb6b66a7afbbb
>> 42b8a7c5712342094eef%7C1%7C0%7C638775427294948313%7CUnknown%7CTWFpbGZs
>> b3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIj
>> oiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=zDJO26hta0rcwbbr68dHaya5
>> NzHex2n8Hk7IN6Xl63k%3D&reserved=0
>>
>> It is Maven based. If I try to run the project I get the following error:
>> Error: JavaFX runtime components are missing, and are required to run
>> this application If I use Run Maven -> Other goals and just hit enter it 
>> runs.
> 
> Ah, OK, you didn't mention JavaFX.  That brings a different complexion to 
> this, as that has its own plugin goals to consider.  This is (was) covered 
> somewhere in the JavaFX docs - check the modular Maven section at 
> https://openjfx.io/openjfx-docs/#IDE-NetBeans
> 
> Anyway, if you want your existing project to work, you need to override the 
> goals attached to the run and other actions in the project properties to call 
> javafx:run instead of the exec plugin.
> This will create an nbactions.xml in the project, which you could choose to 
> check in.
> 
> It's a curious question whether defaultGoal(s) should be considered in any of 
> this.  To be honest, I'd even forgotten that was an option.
> 
> Best wishes,
> 
> Neil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: dev-h...@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: dev-h...@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-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