2012-08-13 46 views
3

我正在编写一个批处理文件来从本地存储库安装eclipse上的功能。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没有设置错误级别?任何可能的解决方法?

+0

如何检查日志文件的输出? – Kane 2012-08-13 07:12:08

+0

顺便说一句,如果你认为这是一个问题,请提交一个针对'p2'的错误。 – Kane 2012-08-13 07:13:13

回答

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

有在春分3.6.0(这是固定在3.6.1)导致故障的应用程序返回的退出代码为0,除非你使用的是春分版,P2导演应用程序有一个bug正确的退出代码。

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