You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Ulrich Mayring <ul...@isys.de> on 2023/12/27 11:08:26 UTC
'Run single' not working outside of IDE 18
Hi folks,
when I "Run single" in one of my projects, then the IDE starts my
program like this (per the Output Window):
JAVA_HOME="/my/path/to/java_sdk_17"
cd /home/myuser/myproject/mysubproject; ../gradlew
-PrunClassName=package.MyMainClass -s -x check -x test runSingle
However, when I use exactly that code from the command line I get the
error message:
org.gradle.execution.TaskSelectionException: Task 'runSingle' not found
in project ':mysubproject'.
../gradlew -version gives me 'Gradle 8.1.1'
Other tasks like "build" etc. do work, it appears only the NB-specific
tasks are not found. What could be the problem here?
--
iSYS Software GmbH
Ulrich Mayring | Full Stack Developer
Technology Lab / R&D
Tel: +49 (0) 89 46 23 28-0 | Fax +49 (0) 89 46 23 28-14
email: ulrich.mayring@isys.de
Grillparzerstraße 10 | D-81675 München
www.isys.de
Sitz der Gesellschaft: München | HRB 111760
Geschäftsführer: Stefan Fischer und Max Haller
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Andreas Reichel <an...@manticore-projects.com>.
On Fri, 2023-12-29 at 11:09 +0100, Ulrich Mayring wrote:
> If this is not a gradlew command-line, but some proprietary syntax,
> then
> how do I need to translate that into Gradle syntax? And how would my
> task "runSingle" then have to look?
@Laszlo,
please is this Netbeans specific Gradle Build file written out
somewhere or can it be written to somewhere (same as the old NB ant
build script was written to the .private folder)?
Cheers
Andreas
Re: 'Run single' not working outside of IDE 18
Posted by Ulrich Mayring <ul...@isys.de>.
> It's not about deprecating an API. It's about to encourage people to
> take care of their build scripts, in order not to rely on our
> heuristics. Also the way IDE actions mapped to build system calls can be
> configured in project properties Build > Build Actions
My brain is probably scrambled here, so could you give me a hint how to
do that? Currently the IDE action "Run File" is mapped to:
-PrunClassName=${selectedClass} ${javaExec.workingDir}
${javaExec.environment} runSingle --stacktrace ${javaExec.jvmArgs}
${javaExec.args}
If this is not a gradlew command-line, but some proprietary syntax, then
how do I need to translate that into Gradle syntax? And how would my
task "runSingle" then have to look?
I suppose I need to replicate what the Build Augmentation does? And
somehow do a better job than the heuristic? :)
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Laszlo Kishalmi <la...@gmail.com>.
On 12/28/23 08:49, Ulrich Mayring wrote:
>> I decided not to leak NetBeans internals into the Output window. That
>> probably would have confused more people, than hiding those things,
>> and again that would leak internals into the output window. I was
>> planning to add an option, that could enable displaying the full
>> command line, if there would be enough complaints.
>
> Well, it turned out that it was the other way round: hiding confused
> the hell out of me :)
Well, I'm sorry about that. Maybe you are not the first one since the
introduction of Gradle in NetBeans 11.0, but the first to raise his
voice about that.
>
> I'm not familiar with NB practices, but for me the whole point of
> logging is to expose internals. Error dialogs should give a
> user-friendly output, but logging is exactly for exposing internals in
> order to facilitate debugging.
>
>> Later on the "best effort" caused some misunderstanding when used
>> with certain plugins, so we decided to deprecate "runSingle",
>> encourage people to inspect and configure their build script right,
>> instead of relying on NetBeans heuristics.
>
> I assumed that "Run Single" and all other commands that are built into
> the IDE are an API that has to be implemented by the authors of a
> build system plugin (like Gradle or Maven). Deprecating this API might
> make it easier for plugin authors, but it will take a feature away
> from users.
Well, the main concept used in Gradle for NetBeans is that is should be
no intrusive. In early days the IDEA and Eclipse plugins were written by
the Gradle team and those plugins were used to create configuration
files for the specific IDEs (like .idea directory and the .project for
Eclipse). NetBeans did not need those plugins defined (maybe it's true
for IDEA and Eclipse by now).
The only time that concept was violated is the runSingle and explodedWar
task injection. Those are for cover shortcomings of Gradle. In the
meantime Gradle evolved a lot, probably by NB21 or NB22 (more specific
Gradle 8.5+) there would be a standard Gradle way to achieve runSingle
without NetBeans augmenting a build.
It's not about deprecating an API. It's about to encourage people to
take care of their build scripts, in order not to rely on our
heuristics. Also the way IDE actions mapped to build system calls can be
configured in project properties Build > Build Actions
>
> Also, if there were conceptual difficulties implementing this API in
> an interoperable manner, then the same problems can be expected for
> users, if we ask them to implement the feature in their build scripts.
> If it were easy to implement in the build script, then surely there
> would be no conceptual problems coming up with a heuristic for the IDE.
>
> As far as I can see, if I have 100 classes that I want to potentially
> run as "Run Single" or 3000 methods that I want to run as "Run focused
> test method", then I need to write 100 or 3000 tasks in the build
> script. The point is that as an IDE user I can click on a method or
> class and say "Run this" or "Test this". So the UI needs to pass the
> selected method or class to the build script. In which case it could
> easily output the generated gradlew (or mvn) command in the Output
> Window. We (users of an IDE) are all developers, too, and not easily
> confused by comprehensive output - more so, however, by incomplete output.
Well, "Run Single" is not supported by Gradle builds, where run, debug
tests and/or test methods are, so we are safe on the test side.
Here you say the users of the IDE are developers. That's not entirely
true, many of them are students, who are often fighting with semicolon
placement problems. For them the injected 'runSingle' task is fine.
I'd say for developers write their own runSingle or extend run task
should not be a problem.
Still, I acknowledge that there are room for improvements. Would that
happen? Maybe. Usual time and money issue (where time is money). I'd
encourage you to step up, if something bugs you, provide a PR, add
documentation, etc. Contribute!
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Ulrich Mayring <ul...@isys.de>.
> I decided not to leak NetBeans internals into the Output window. That
> probably would have confused more people, than hiding those things, and
> again that would leak internals into the output window. I was planning
> to add an option, that could enable displaying the full command line, if
> there would be enough complaints.
Well, it turned out that it was the other way round: hiding confused the
hell out of me :)
I'm not familiar with NB practices, but for me the whole point of
logging is to expose internals. Error dialogs should give a
user-friendly output, but logging is exactly for exposing internals in
order to facilitate debugging.
> Later on the "best effort" caused some misunderstanding when used with
> certain plugins, so we decided to deprecate "runSingle", encourage
> people to inspect and configure their build script right, instead of
> relying on NetBeans heuristics.
I assumed that "Run Single" and all other commands that are built into
the IDE are an API that has to be implemented by the authors of a build
system plugin (like Gradle or Maven). Deprecating this API might make it
easier for plugin authors, but it will take a feature away from users.
Also, if there were conceptual difficulties implementing this API in an
interoperable manner, then the same problems can be expected for users,
if we ask them to implement the feature in their build scripts. If it
were easy to implement in the build script, then surely there would be
no conceptual problems coming up with a heuristic for the IDE.
As far as I can see, if I have 100 classes that I want to potentially
run as "Run Single" or 3000 methods that I want to run as "Run focused
test method", then I need to write 100 or 3000 tasks in the build
script. The point is that as an IDE user I can click on a method or
class and say "Run this" or "Test this". So the UI needs to pass the
selected method or class to the build script. In which case it could
easily output the generated gradlew (or mvn) command in the Output
Window. We (users of an IDE) are all developers, too, and not easily
confused by comprehensive output - more so, however, by incomplete output.
---------------------------------------------------------------------
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
unsubscribe
Posted by lostbits <fo...@slipbits.com>.
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Laszlo Kishalmi <la...@gmail.com>.
On 12/28/23 01:34, Ulrich Mayring wrote:
> I find that most unfortunate. I've been using Netbeans for many years
> and the one clear advantage it always had for me over other IDEs is
> that it was just a frontend to my build script. So everything would
> behave exactly the same in the IDE as it would later in the CI process.
>
> Is this a newer development or has it been that way forever and I just
> never noticed? I seem to remember that I have occasionally copied
> commands from the output window to the command line and it always
> worked - perhaps the runSingle command is different from other
> commands in that regard?
>
> In any case, I believe if the IDE outputs what looks like a script,
> then that script should work. So I take it that some vital pre- or
> post-commands are missing from the output?
>
Well, you are right. I was thinking about it, when I wrote the specific
code. So a little background:
There are a few things Gradle build does not support on their own,
however it would be really handy in the IDE, these are running a single
java file, and supporting "exploded" war deployment. NetBeans is
injecting these support when the Augmented Build Execution is enabled on
the root project. These injections on "best effort" based, and the most
often used runSingle has been deprecated in NB19
I decided not to leak NetBeans internals into the Output window. That
probably would have confused more people, than hiding those things, and
again that would leak internals into the output window. I was planning
to add an option, that could enable displaying the full command line, if
there would be enough complaints.
Later on the "best effort" caused some misunderstanding when used with
certain plugins, so we decided to deprecate "runSingle", encourage
people to inspect and configure their build script right, instead of
relying on NetBeans heuristics.
>
> Am 28.12.23 um 04:50 schrieb Laszlo Kishalmi:
>> NetBeans has it's own Gradle Init Script which can inject tasks into
>> the Gradle build. That script is not presented in the executed
>> command line.
>>
>> If you intend to use a runSingle task outside of NetBeans, it's
>> better to define that task in the build.gradle file. When it is
>> present NetBeans will also attempt to use task instead of injecting one.
>>
>> On 12/27/23 03:08, Ulrich Mayring wrote:
>>> Hi folks,
>>>
>>> when I "Run single" in one of my projects, then the IDE starts my
>>> program like this (per the Output Window):
>>>
>>> JAVA_HOME="/my/path/to/java_sdk_17"
>>> cd /home/myuser/myproject/mysubproject; ../gradlew
>>> -PrunClassName=package.MyMainClass -s -x check -x test runSingle
>>>
>>> However, when I use exactly that code from the command line I get
>>> the error message:
>>>
>>> org.gradle.execution.TaskSelectionException: Task 'runSingle' not
>>> found in project ':mysubproject'.
>>>
>>> ../gradlew -version gives me 'Gradle 8.1.1'
>>>
>>> Other tasks like "build" etc. do work, it appears only the
>>> NB-specific tasks are not found. What could be the problem here?
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>>
>
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Andreas Reichel <an...@manticore-projects.com>.
On Thu, 2023-12-28 at 12:24 +0100, Ulrich Mayring wrote:
> then I would find it a valuable feature to be able to do that on the
> command-line as well. If the IDE is not able to do this via Gradle,
> then
> it should not pretend to do so by outputting gradlew scripts.
I am very sure, that somewhere hidden, Netbeans writes its own
`build_nb.gradle` similarly to the `.private/netbeans.ant.xml` or
whatever the name was before.
You just need to find it 😄 (maybe `tail -f ./` your project folder
while executing under NetBeans).
To be fair, the developers are doomed if they do and also when they
don't: I hate it when IDE specific stuff is spoiling my project folder
and maintain rather large .gitignore files to get rid of that stuff. So
the last thing I wanted to see was a `build_nb.gradle` showing up in my
project directory.
You on the other hand are looking for exactly that one: the NB blended
version of the `gradle.build` and I guess we both have a strong point.
So maybe find this NB blended version of the `gradle.build` and soft-
link to it.
And maybe the developers can fix the IDE logging and point to the
`build_nb.gradle` instead to the standard `build.gradle`
Cheers
Andreas
Re: 'Run single' not working outside of IDE 18
Posted by Ulrich Mayring <ul...@isys.de>.
> 1) you work with Gradle, where the Gradle Build file defines the build
> logic (and Netbeans has to follow it)
Agreed.
> 2) but (respectfully!) you still seem to look at it with "Ant" glasses,
> when Netbeans built the logic and the script for you (because no sane
> person could be bothered to built ant scripts from scratch)
Also agreed. The IDE provides functionality above and beyond the build
script (otherwise why use an IDE?). If the IDE is able to "Run Single"
or "Run focused Test Method" on the basis of the provided Gradle script,
then I would find it a valuable feature to be able to do that on the
command-line as well. If the IDE is not able to do this via Gradle, then
it should not pretend to do so by outputting gradlew scripts.
> In my understanding, this is pretty much a legacy from the ANT script
> days, when Netbeans was in the lead to define the build logic.
> With Gradle indeed this may do more harm than good now.
Thanks for shattering this dream I was living in :)
Sounds like I was wrong all those years about how the IDE actually
works. But I was also misled big time by the output window.
--
iSYS Software GmbH
Ulrich Mayring | Full Stack Developer
Technology Lab / R&D
Tel: +49 (0) 89 46 23 28-0 | Fax +49 (0) 89 46 23 28-14
email: ulrich.mayring@isys.de
Grillparzerstraße 10 | D-81675 München
www.isys.de
Sitz der Gesellschaft: München | HRB 111760
Geschäftsführer: Stefan Fischer und Max Haller
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Andreas Reichel <an...@manticore-projects.com>.
On Thu, 2023-12-28 at 11:48 +0100, Ulrich Mayring wrote:
> Does this select the correct class? The original command-line
> included
> -PrunClassName=package.MyMainClass as a parameter.
You can also forward the Class to run as a parameter.
>
> But anyway, I think with some tweaking and twiddling it will be
> possible
> to write a task that replicates 99% of what the IDE does. But I'm not
> sure whether that is the assignment.
I agree because you are somewhere between a rock and a hard place right
now:
1) you work with Gradle, where the Gradle Build file defines the build
logic (and Netbeans has to follow it)
2) but (respectfully!) you still seem to look at it with "Ant" glasses,
when Netbeans built the logic and the script for you (because no sane
person could be bothered to built ant scripts from scratch)
> The point is to replicate exactly what the IDE does on the command-
> line,
> so that I can debug it better using other command-line tools.
Then provide your own Gradle Build file (from scratch) and define the
task `singleRun` has entry hook for Netbeans.
You just need to change the direction: you define the build file and
lead the way, Netbeans will follow (instead the other way around).
> then IMHO it should not pretend so by outputting stuff
> that looks like a script.
In my understanding, this is pretty much a legacy from the ANT script
days, when Netbeans was in the lead to define the build logic.
With Gradle indeed this may do more harm than good now.
Good luck and cheers
Andreas
Re: 'Run single' not working outside of IDE 18
Posted by Ulrich Mayring <ul...@isys.de>.
Does this select the correct class? The original command-line included
-PrunClassName=package.MyMainClass as a parameter.
But anyway, I think with some tweaking and twiddling it will be possible
to write a task that replicates 99% of what the IDE does. But I'm not
sure whether that is the assignment.
The point is to replicate exactly what the IDE does on the command-line,
so that I can debug it better using other command-line tools.
So if the IDE actually executes a command-line script, then I want to
see exactly that, not just bits and pieces. If the IDE does not actually
execute a script, then IMHO it should not pretend so by outputting stuff
that looks like a script.
Am 28.12.23 um 11:07 schrieb Andreas Reichel:
> On Thu, 2023-12-28 at 16:59 +0700, Andreas Reichel wrote:
>> On Thu, 2023-12-28 at 10:48 +0100, Ulrich Mayring wrote:
>>> Well, how would I know how to define this task? I want it to do exactly
>>> what "Run Single" in the IDE does. So how to write this task?
>
> Please disregard, this one works correctly:
>
> tasks.register('singleRun'){
> dependsOn run
> }
>
>
> Then you can call from command line:
>
> ./gradlew singleRun -x test -x check
>
>
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Andreas Reichel <an...@manticore-projects.com>.
On Thu, 2023-12-28 at 16:59 +0700, Andreas Reichel wrote:
> On Thu, 2023-12-28 at 10:48 +0100, Ulrich Mayring wrote:
> > Well, how would I know how to define this task? I want it to do
> > exactly
> > what "Run Single" in the IDE does. So how to write this task?
Please disregard, this one works correctly:
tasks.register('singleRun') {
dependsOn run
}
Then you can call from command line:
./gradlew singleRun -x test -x check
Re: 'Run single' not working outside of IDE 18
Posted by Andreas Reichel <an...@manticore-projects.com>.
On Thu, 2023-12-28 at 10:48 +0100, Ulrich Mayring wrote:
> Well, how would I know how to define this task? I want it to do
> exactly
> what "Run Single" in the IDE does. So how to write this task?
This should work as long as you have a simple single Java Application
which you would like to execute:
singleRun {
afterEvaluate {
run()
}
}
Re: 'Run single' not working outside of IDE 18
Posted by Ulrich Mayring <ul...@isys.de>.
Well, how would I know how to define this task? I want it to do exactly
what "Run Single" in the IDE does. So how to write this task?
Am 28.12.23 um 10:39 schrieb Andreas Reichel:
> On Thu, 2023-12-28 at 10:34 +0100, Ulrich Mayring wrote:
>> I find that most unfortunate. I've been using Netbeans for many years
>> and the one clear advantage it always had for me over other IDEs is that
>> it was just a frontend to my build script.
>
>
> Greetings!
>
> You still can very much achieve that: Just edit your gradle.build file,
> add the task `runSingle` and define, what it exactly it shall do (e. g.
> which of your tasks is shall execute).
>
> Cheers
> Andreas
--
iSYS Software GmbH
Ulrich Mayring | Full Stack Developer
Technology Lab / R&D
Tel: +49 (0) 89 46 23 28-0 | Fax +49 (0) 89 46 23 28-14
email: ulrich.mayring@isys.de
Grillparzerstraße 10 | D-81675 München
www.isys.de
Sitz der Gesellschaft: München | HRB 111760
Geschäftsführer: Stefan Fischer und Max Haller
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Andreas Reichel <an...@manticore-projects.com>.
On Thu, 2023-12-28 at 10:34 +0100, Ulrich Mayring wrote:
> I find that most unfortunate. I've been using Netbeans for many years
> and the one clear advantage it always had for me over other IDEs is
> that
> it was just a frontend to my build script.
Greetings!
You still can very much achieve that: Just edit your gradle.build file,
add the task `runSingle` and define, what it exactly it shall do (e. g.
which of your tasks is shall execute).
Cheers
Andreas
Re: 'Run single' not working outside of IDE 18
Posted by Ulrich Mayring <ul...@isys.de>.
I find that most unfortunate. I've been using Netbeans for many years
and the one clear advantage it always had for me over other IDEs is that
it was just a frontend to my build script. So everything would behave
exactly the same in the IDE as it would later in the CI process.
Is this a newer development or has it been that way forever and I just
never noticed? I seem to remember that I have occasionally copied
commands from the output window to the command line and it always worked
- perhaps the runSingle command is different from other commands in that
regard?
In any case, I believe if the IDE outputs what looks like a script, then
that script should work. So I take it that some vital pre- or
post-commands are missing from the output?
Am 28.12.23 um 04:50 schrieb Laszlo Kishalmi:
> NetBeans has it's own Gradle Init Script which can inject tasks into the
> Gradle build. That script is not presented in the executed command line.
>
> If you intend to use a runSingle task outside of NetBeans, it's better
> to define that task in the build.gradle file. When it is present
> NetBeans will also attempt to use task instead of injecting one.
>
> On 12/27/23 03:08, Ulrich Mayring wrote:
>> Hi folks,
>>
>> when I "Run single" in one of my projects, then the IDE starts my
>> program like this (per the Output Window):
>>
>> JAVA_HOME="/my/path/to/java_sdk_17"
>> cd /home/myuser/myproject/mysubproject; ../gradlew
>> -PrunClassName=package.MyMainClass -s -x check -x test runSingle
>>
>> However, when I use exactly that code from the command line I get the
>> error message:
>>
>> org.gradle.execution.TaskSelectionException: Task 'runSingle' not
>> found in project ':mysubproject'.
>>
>> ../gradlew -version gives me 'Gradle 8.1.1'
>>
>> Other tasks like "build" etc. do work, it appears only the NB-specific
>> tasks are not found. What could be the problem here?
>>
>
> ---------------------------------------------------------------------
> 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
>
--
iSYS Software GmbH
Ulrich Mayring | Full Stack Developer
Technology Lab / R&D
Tel: +49 (0) 89 46 23 28-0 | Fax +49 (0) 89 46 23 28-14
email: ulrich.mayring@isys.de
Grillparzerstraße 10 | D-81675 München
www.isys.de
Sitz der Gesellschaft: München | HRB 111760
Geschäftsführer: Stefan Fischer und Max Haller
---------------------------------------------------------------------
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: 'Run single' not working outside of IDE 18
Posted by Laszlo Kishalmi <la...@gmail.com>.
NetBeans has it's own Gradle Init Script which can inject tasks into the
Gradle build. That script is not presented in the executed command line.
If you intend to use a runSingle task outside of NetBeans, it's better
to define that task in the build.gradle file. When it is present
NetBeans will also attempt to use task instead of injecting one.
On 12/27/23 03:08, Ulrich Mayring wrote:
> Hi folks,
>
> when I "Run single" in one of my projects, then the IDE starts my
> program like this (per the Output Window):
>
> JAVA_HOME="/my/path/to/java_sdk_17"
> cd /home/myuser/myproject/mysubproject; ../gradlew
> -PrunClassName=package.MyMainClass -s -x check -x test runSingle
>
> However, when I use exactly that code from the command line I get the
> error message:
>
> org.gradle.execution.TaskSelectionException: Task 'runSingle' not
> found in project ':mysubproject'.
>
> ../gradlew -version gives me 'Gradle 8.1.1'
>
> Other tasks like "build" etc. do work, it appears only the NB-specific
> tasks are not found. What could be the problem here?
>
---------------------------------------------------------------------
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