Search code examples
eclipseeclipse-pluginbatch-filep2

eclipse does not return errorlevel


I am writing a batch file to install features on eclipse from a local repository.

eclipse.exe -application org.eclipse.equinox.p2.director
  -repository C:/repo,http://download.eclipse.org/releases/indigo/
  -installIU com.app.feature.feature.group

but i am not able to detect if the operation failed or succeeded from the batch script. It seems eclipse does not set error level? Any possible workarounds?


Solution

  • One workaround that i found is running the command through ant exec instead of calling directly from batch file. It reports all the errors.

    <exec executable="eclipse.exe" failonerror="true">
      <arg value="-noSplash"/>
      <arg value="-application"/>
      <arg value="org.eclipse.equinox.p2.director"/>
      <arg value="-repository"/>
      <arg value="file:C:/repo,http://download.eclipse.org/releases/indigo/"/>
      <arg value="-installIU"/>
      <arg value="com.app.feature.feature.group"/>
    </exec>