Eclipse不返回errorlevel。

3
我正在编写一个批处理文件,从本地存储库安装eclipse的功能。
eclipse.exe -application org.eclipse.equinox.p2.director
  -repository C:/repo,http://download.eclipse.org/releases/indigo/
  -installIU com.app.feature.feature.group

但我无法从批处理脚本中检测操作是否成功或失败。似乎Eclipse没有设置错误级别?有什么可能的解决方法吗?

检查日志文件的输出怎么样? - Kane
顺便说一下,如果您认为'p2'存在问题,请提交一个错误报告。 - Kane
2个回答

1

我发现的一个解决方法是通过ant exec运行命令,而不是直接从批处理文件中调用。这样可以报告所有错误。

<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>

0

在Equinox 3.6.0中存在一个错误(已在3.6.1中修复),导致失败的应用程序返回退出代码0。除非您正在使用该Equinox版本,否则p2 director应用程序具有正确的退出代码。

我想问题在于您如何检查批处理脚本中的退出代码。您可以使用IF ERRORLEVEL 1 GOTO LabelOfErrorHandling来检查非零退出代码。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接