public void execute ( ) throws MojoExecutionException { if ( properties == null ) { getLog ( ) . warn ( "run-script failed: No properties supplied" ) ; return ; } boolean bSuccess = false ; Environment env = null ; RunScriptProcess process = null ; try { env = new Environment ( properties ) ; Application app = new ThinApplication ( env , properties , null ) ; Task task = new AutoTask ( app , null , null ) ; process = new RunScriptProcess ( task , null , null ) ; bSuccess = ( process . doRunCommand ( null , properties ) == DBConstants . NORMAL_RETURN ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( process != null ) process . free ( ) ; if ( env != null ) env . free ( ) ; } if ( bSuccess ) getLog ( ) . info ( "run-script ran successfully: " + properties . get ( DBParams . PROCESS ) ) ; else getLog ( ) . warn ( "run-script failed: " + properties . get ( DBParams . PROCESS ) ) ; }
Execute the script mojo .