You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Scott Palmer <sw...@gmail.com> on 2021/03/03 17:35:52 UTC

Setting JVM args for Run Single File in Gradle project

Just a quick question... How do I configure JVM options for running a
single file (via right-click) for a Gradle project in NB 12.x?
(I need to add a javaagent.)

If there are docs somewhere please let me know.

Thanks,

Scott

Re: Setting JVM args for Run Single File in Gradle project

Posted by Scott Palmer <sw...@gmail.com>.
That works for me.  I did dig around and found the task name and property
in the run.single "Build Action" for the project.  It just meant digging a
little bit deeper than I was expecting and realizing that I could define my
own runSingle task instead of relying on the one NB must be adding
dynamically.

This is the sort of thing that should find a place in documentation.  Mayne
here: Java SE Learning Trail (apache.org)
<http://netbeans.apache.org/kb/docs/java/index.html>  There is a small
section for Maven, but nothing for Gradle.

Yes, I know, pull requests are welcome :-)

Cheers,

Scott

On Wed, Mar 3, 2021 at 12:55 PM Laszlo Kishalmi <la...@gmail.com>
wrote:

> Well, that's not really supported without any tweaks.
>
> There is workaround though:
>
> Create a custom task named: runSingle (It might be a JavaExec type) in
> your Gradle build. It can use the following project properties:
>
> runClassName for the main class to be run and runArgs which is a string
> for the arguments (needed to be processed to array first), if that's
> being used
>
> Configure your extra JVM Args in the runSingle task.
>
>
> On 3/3/21 9:35 AM, Scott Palmer wrote:
> > Just a quick question... How do I configure JVM options for running a
> > single file (via right-click) for a Gradle project in NB 12.x?
> > (I need to add a javaagent.)
> >
> > If there are docs somewhere please let me know.
> >
> > Thanks,
> >
> > Scott
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>

Re: Setting JVM args for Run Single File in Gradle project

Posted by Laszlo Kishalmi <la...@gmail.com>.
Well, that's not really supported without any tweaks.

There is workaround though:

Create a custom task named: runSingle (It might be a JavaExec type) in 
your Gradle build. It can use the following project properties:

runClassName for the main class to be run and runArgs which is a string 
for the arguments (needed to be processed to array first), if that's 
being used

Configure your extra JVM Args in the runSingle task.


On 3/3/21 9:35 AM, Scott Palmer wrote:
> Just a quick question... How do I configure JVM options for running a 
> single file (via right-click) for a Gradle project in NB 12.x?
> (I need to add a javaagent.)
>
> If there are docs somewhere please let me know.
>
> Thanks,
>
> Scott

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

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