title: Executing a Java jar file from within a SoapUI groovy script not working
body: <p>I am new to SoapUI and Groovy so please forgive this post as it has been posted a number of times in Stackoverflow however I cannot find a fix.</p>
  
  <p>SoapUI version:  4.5.2</p>
  
  <p>I have 2 questions if you guys don't mind:</p>
  
  <ol>
  <li>I have an executable jar file that I've put in the the \bin\ext directory along with another jar that is considered a dependency jar within the code in the jar so I hope it will reference there. The groovy code I found in Stackoverflow that should execute this jar is as follows but does not work as I don't see any output anywhere in the SoapUI directory. </li>
  </ol>
  
  <p>Here is the code:</p>
  
  <pre><code>def command = "java -jar UpdateAppIdXMLRequest.jar file.xml"
  def process = command.execute()
  process.waitFor()
  
  def output = process.in.text
  log.info output
  </code></pre>
  
  <ol>
  <li>This jar creates 25 xml files that should be able to be picked up by the SoapUI and put them in as TestSteps in the same project. In my java code in what path do I put these files?</li>
  </ol>
  
  <p>Here is the code in my jar:</p>
  
  <pre><code>import java.io.File;
  import java.io.FileWriter;
  import java.io.IOException;
  
  import org.jdom2.Document;
  import org.jdom2.Element;
  import org.jdom2.JDOMException;
  import org.jdom2.input.SAXBuilder;
  import org.jdom2.output.Format;
  import org.jdom2.output.XMLOutputter;
  
  class UpdateAppIdXMLRequest {
  
      static main(args) {
  
          try {
  
            SAXBuilder builder = new SAXBuilder();
            File xmlFile = new File("c:\\file.xml");
  
            Document doc = (Document) builder.build(xmlFile);
            Element rootNode = doc.getRootElement();
  
            // Create loop to create 25 testStepApps
            for (int i = 1; i &lt; 26; i++) {
  
                // Get current AppID, incrementAppID and update the ApplicationNumber attribute value for next test script.
                int appID = Integer.parseInt(rootNode.getAttributeValue("ApplicationNumber"));
                appID++;
                String appIDValue = Integer.toString(appID);
                rootNode.getAttribute("ApplicationNumber").setValue(appIDValue);
  
                XMLOutputter xmlOutput = new XMLOutputter();
  
                // Create new XML file with next AppID
                xmlOutput.setFormat(Format.getPrettyFormat());
                xmlOutput.output(doc, new FileWriter("c:\\testStepApp" + i + ".xml"));
  
                // xmlOutput.output(doc, System.out);
  
                // System.out.println("File updated!");
            }
          } catch (IOException io) {
            io.printStackTrace();
          } catch (JDOMException e) {
            e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>Any help/direction would be appreciated.    </p>
  
  <p>Thanks.</p>