Exit from Main.main function after db creation issue.


I’ve created db using command line.


            Main.main( new String[]{





        }catch(Exception e){

            System.out.println(  e );


        System.out.println( “QQQQ” );

In the output I can see, that sql scripts are executed:

  • Connected to SA@jdbc:hsqldb:mem:datasourcedb
  • Successfully released change log lock
  • Liquibase Update Successful

  • But for some reason I can not see the output from System.out.println.

    It seems I cannot exit from Main.main. 

    Any Idea?

    I can re-create the issue and it is because at the end of the Main.main method, the code calls System.exit(0) rather than just returning.  The main method can return 0, -1, -2 or -3 depending on the results.

    Unexpected results get returns -3.
    Command line parsing exceptions return -2
    Failures return -1
    Success returns 0

    All of the above use System.exit() with the return codes listed above.