title: Error when execute MavenCli in the loop (maven-embedder)?
body: <p>What is the problem when I execute the maven command in the loop ? The goal is to update the version of pom.xml of the list of bundles. The first iteration, maven execute correctly (update pom.xml), but it makes error for all item after.</p>
  
  <pre><code>for (String bundlePath: bundlesToUpdate)
  {
      MavenCli cli = new MavenCli();
  String[] arguments = {
      "-Dtycho.mode=maven", 
          "org.eclipse.tycho:tycho-versions-plugin:set-version", 
      "-DgenerateBackupPoms=false", 
      "-DnewVersion=" + version};
      int result = cli.doMain(arguments, bundlePath, System.out, System.err);
  }
  </code></pre>
  
  <p>Same error with the code:</p>
  
  <pre><code>`MavenCli cli = new MavenCli();
  for (String bundlePath: bundlesToUpdate) 
  {
      String[] arguments = {
      "-Dtycho.mode=maven", 
      "org.eclipse.tycho:tycho-versions-plugin:set-version", 
      "-DgenerateBackupPoms=false", 
      "-DnewVersion=" + version};
  int result = cli.doMain(arguments, bundlePath, System.out, System.err);
  }`
  </code></pre>
  
  <p>First time, it's ok:</p>
  
  <pre><code>[main] INFO org.eclipse.tycho.versions.manipulation.PomManipulator -   pom.xml//project/version: 2.2.6-SNAPSHOT =&gt; 2.2.7-SNAPSHOT
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Reactor Summary:
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - 
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - XXXX project   ....................... SUCCESS [  0.216 s]
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - com.sungard.valdi.bus.fixbroker.client.bnp ........ SKIPPED
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - XXX project Feature ...................... SKIPPED
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD SUCCESS
  </code></pre>
  
  <p>After the errors are:</p>
  
  <pre><code>[main] ERROR org.apache.maven.cli.MavenCli - Error executing Maven.
  [main] ERROR org.apache.maven.cli.MavenCli - java.util.NoSuchElementException
    role: org.apache.maven.eventspy.internal.EventSpyDispatcher
  roleHint: 
  [main] ERROR org.apache.maven.cli.MavenCli - Caused by: null
  [main] ERROR org.apache.maven.cli.MavenCli - Error executing Maven.
  [main] ERROR org.apache.maven.cli.MavenCli - java.util.NoSuchElementException
        role: org.apache.maven.eventspy.internal.EventSpyDispatcher
  roleHint: 
  </code></pre>