mvm quarkus:dev now has commandline interactive interface how can I turn it off? - maven

I run quarkus using the command
mvn quarkus:dev
In the past this was fine but now the output is interspersed with an interactive curses based menu like below :
Tests paused
Press [r] to resume testing, [o] Toggle test output, [h] for more options>
I am spawning several quarkus processes at one time and redirecting the output into a UI I created to aggregate the output so I'm not flipping back and forth between 7 terminal windows. The recent introduction of this "feature" apparently causes the normal output to either be redirected directly to the tty because the redirection of stderr/stdout is no logger being picked up by my application. How can I remove this feature from quarkus:dev ?

Use mvn quarkus:dev -Dquarkus.console.enabled='false'

Related

Output depends if program its attached to a console

Gradle has option console which behaves differently if gradle is not attached to a console. From docs:
--console=(auto,plain,rich,verbose)
...
Set to auto (the default) to enable color and other rich output in the console output
when the build process is attached to a console, or to generate plain text only when not
attached to a console. This is the default when Gradle is attached to a terminal.
When I run it locally with default parameter I see rich output, but when in Jenkins - plain.
What does is mean when program is attached to a terminal? Don't we always run CLI programs through the terminal?

Debug jHipster application

I'm new to jHipster, I've created APIs which are consumed by my application's front end. I want to debug my services but unable to attach debugger with IntelliJ.
My application starts by running command "mvnw" which is jHispter standard command when I opened this bat file in editor i found this :
#REM e.g. to debug Maven itself, use
#REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
I setup MAVEN_OPTS environment variable but still it was of no use. I also tried to make a remote connection from IDE on port 8000 but still, it didn't serve a purpose.
Any help will be appreciated, thanks.
you can just run (in debug mode) the main method in the JhipApp Class (the SpringBootApplication Class). It worked for me
My tested and proven solution for debugging and then dividing the front end with the back ends, works for OS Windows and Ubuntu with the use of the latest version of the Ide Intellij Community (2020.1.1 used in both OS), provides that after creating a jhipster app (created with Ubuntu), from the command promp or from the Ubuntu shell launch the command: mvn -DskipTests = true clean install to compile the back end first and then the front end (in Angular 8 in my case), at the end of this compilation run the following command: mvn spring-boot: run.
After launching the application, click Ctrl + C and stop the run. Now you can launch the npm commands and then the command: npm start from the same command prompt or from the shell, since your project has been built and already launched it will be restarted and now from the Ide you can launch your class configuration annotated with #SpringBootApplication from the debug icon, at the end of the compilation you will have front ends and back ends divided and debuggable easily as well as hot changes for the front end take place quickly, while for the back end you will always have to save recompile and restart in debug.
You can do it, if you connect remotely, as you suggested in your question
Start jhipster in the terminal, but pass in some debug params
$ ./mvnw -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
Then you just connect to it using your IDE at port 5005.
For example, in Visual Studio Code
add a "launch.json" file
A "Add Configuration" button will be displayed when you have the launch.json as the active file in the editor. Click it.
Choose "Java: Attach by Process Id"
That will add a new configuration to the "Run and Debug" tab.
Click the "Attach by Process ID", button, and choose your process (port 5005 in this example)
Debugging will begin!

Thorntail not exiting gracefully

I'm running a Thorntail 2.2.1.Final microservice with Maven using either of these commands
mvn thorntail:start
mvn thorntail:run
It runs fine, but when I hit Ctrl-C it doesn't exit the application i.e. the console returns, but the app runs in the background. I've tried to stop it
mvn thorntail:stop
But that doesn't work. I have to go and kill the process. I'm using Windows 10.
The thorntail:start and thorntail:stop goals are meant to be used together as part of a Maven lifecycle, typically for integration testing. That is, thorntail:start intentionally leaves the process running in the background, and thorntail:stop should stop it.
For interactive use, mvn thorntail:run should be used. That keeps waiting in the foreground, and Ctrl+C should stop the application behind it.
If none of that works, it's a bug. I'd recommend filing a bug in https://issues.jboss.org/browse/THORN and preferrably also include a jstack output for the process.

Jenkins : Selenium GUI tests not visible in browser when I click build w/o using command prompt

I simply want to navigate to Jenkins, click build, and see the test execution in the browser. I don't want to use the command java -jar jenkins.war in the command prompt to get the browser to appear when I run my automated test. Any possible solutions?
They have a solution here
Solution 1: Enable "Allow service to interact with Desktop"
Tried it, it didn't work on my machine running in Windows 10
Solution 2: Through CMD using jenkins.war

Can't execute .exe with an additional param using the .bat file

I need to run NetBeans 7.4 with an additional param such as --locale en:US.
I have no problems doing this using wingows 7 console like this:
>b:
>cd "Program Files\NetBeans 7.4\bin"
>netbeans64.exe --locale en:US
But this way is very cumbersome. Besides it closes the program itself if I close the console.
So I tryed to make a .bat file with the following content:
#echo off
echo Netbeans
start "netbeans" "b:\Program Files\NetBeans 7.4\bin\netbeans64.exe --locale en:US"
pause
exit
However this solution doesn't work. It tells that it can't find this file. If I remove the param '--locale en:US' it founds it. But it is necessary to use this param.
Something should be changed, but how?
Almost done. Just change where the quotes are placed
start "netbeans" "b:\Program Files\NetBeans 7.4\bin\netbeans64.exe" --locale en:US
And, for the console problem, from netbeans launcher documentation
Default behaviour - parent process console is attached. This means if
netbeans.exe is started from console it is "reused" for output, if
netbeans.exe is started by shortcut no console is created
If option "--console new" is specified netbeans.exe creates new
console for output. This is useful if you want to start NB by
shortcut and you want still see console output or if you need to
start several NB instances with different user dirs. Console window
will have correct icon and corresponding title e.g. netbeans
--userdir d:\test_userdir --console new) so it is easy to distinguish which console belongs to certain NB instance
If option "--console suppress" is specified no output will be written
to console you invoke it from
In this moment i have no access to netbeans installation to test, but it seems there are three ways
Start with --console new so netbeans gets its own console and do not depend on cmd
Start with --console suppress to dettach from console
Create a shortcut to netbeans (with your parameters, of course). If it is necessary to start netbeans from console, start the .lnk file (shortcut) instead of netbeans executable.
As said, i can not try. Maybe this works.

Resources