private void wsdlCommand ( ) throws MojoExecutionException { String cmd = findWsdlCommand ( ) ; int i = 0 ; for ( String location : wsdlLocations ) { String outputFilename = new File ( outputDirectory , namespace + ( i ++ ) + ".cs" ) . getAbsolutePath ( ) ; String [ ] command = new String [ ] { cmd , serverParameter , "/n:" + namespace , location , "/out:" + outputFilename } ; ProcessBuilder builder = new ProcessBuilder ( ) ; builder . redirectErrorStream ( true ) ; builder . command ( command ) ; try { executeACommand ( builder . start ( ) ) ; } catch ( IOException | InterruptedException e ) { throw new MojoExecutionException ( "Error, while executing command: " + Arrays . toString ( command ) + "\n" , e ) ; } cspath . add ( outputFilename ) ; } try { FileComparer . removeSimilaritiesAndSaveFiles ( cspath , getLog ( ) , windowsModus ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "It was not possible, to remove similarities form the files" , e ) ; } }
Search for the wsdl command and execute it when it is found