1

I want to create a small Monitoring tool for several maven projects.

I have three server applications, which should run while in development. We currently have a small shell script that runs them, but is spectacularly inexact when viewing the logs and annoying to restart them and kill the processes. Which also won't work under Windows. That's why I want to have a small monitoring tool for the other developers, to optimize viewing the status, logs etc. in realtime.

I use the Maven embedder, but when I run the MavenCli, no logs appear.

How to I access the logging stream of the maven projects? printlines and errors are accessible.

My the baseline of my code is the following:

public static void main(String args[]){
  MavenCLI cli = new MavenCLI();
  int result = cli.doMain(new String[] {"clean","spring-boot:run"}, "/path/to/project", System.out, System.err);
}
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Luxusproblem
  • 1,913
  • 11
  • 23
  • I would suggest to start a Spring boot application via ProcessBuilder as it would being started manually via command line (`java -jar spring-boot-app.jar -D...`) that's much easier and more realistic than indirectly over Maven..... – khmarbaise Apr 03 '20 at 10:32

0 Answers0