集成Ant构建器到Eclipse:错误"变量引用空选择" [英] Integrate Ant builder into Eclipse: Error "Variable references empty selection"

查看:1281
本文介绍了集成Ant构建器到Eclipse:错误"变量引用空选择"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Eclipse JDT项目的一些Ant任务,我希望每个编译之前执行的,所以我增加了一个Ant构建器到我的Eclipse的建设者配置。作为构建文件的位置,我进入

I have some Ant tasks in my Eclipse JDT project that I want to execute before each compilation, so I added an Ant builder to my Eclipse builder config. As the location of the build file, I entered

${workspace_loc:${project_path}/build.xml}

我做的的希望有任何绝对路径,或者项目名称,在这里。 Eclipse配置是存储库的一部分,而其他用户检查了这一点用不同的文件系统布局和可能不同的Eclipse项目的名称。例如,我通常有同一项目的多个工作副本在我的Eclipse工作区,每个课程有不同的项目名称。

I do not want to have any absolute paths, or the project name, here. The Eclipse configuration is part of the repository, and other users check this out with different file-system layouts and possibly different Eclipse project names. For example, I usually have several working copies of the same project in my Eclipse workspace, each of course with a different project name.

这工作的大部分时间。不过,我有时在对话框中收到以下错误信息:

This works most of the time. However, I sometimes get the following error message in a dialog box:

错误在生成过程中发生的。结果
  故障运行建设者项目MyProjectName'集成外部工具生成器'。结果
  变量引用空选择:$ {} project_path结果
  变量引用空选择:$ {} project_path

Errors occurred during the build.
Errors running builder 'Integrated External Tool Builder' on project 'MyProjectName'.
Variable references empty selection: ${project_path}
Variable references empty selection: ${project_path}

这似乎在Eclipse的决定,而没有该项目的资源在Package Explorer中选择建设项目发生。我可以通过在项目中的虚拟文件,删除文件Eclipse之外,在Eclipse中选择它,pressing <大骨节病> F5 重现。 Eclipse会注意到,文件不再存在,从包资源管理器中删除它(所以没有什么是再选中),然后生成项目,给予错误信息。

This seems to happen when Eclipse decides to build the project while no resource of the project is selected in the Package Explorer. I can reproduce it by creating a dummy file in the project, deleting the file outside of Eclipse, selecting it in Eclipse and pressing F5. Eclipse will note that the file no longer exists, remove it from the Package Explorer (so nothing is selected anymore) and then build the project, giving the error message.

虽然它不是真的那么重要的Ant任务是为每个编译运行,我不希望有这样的错误消息框,这将混淆用户。

While it's not really that important that the Ant tasks are run for every compilation, I do not want to have such an error message box which will confuse users.

所以,我怎么能


  • 引用build.xml文件以不同的方式,使问题消失,或

  • 解决问题,或

  • 燮preSS此特定错误的错误对话框?

任何帮助将是AP preciated。我使用Eclipse 3.7(蓝色)。

Any help would be appreciated. I'm using Eclipse 3.7 (Indigo).

推荐答案

显然,这里面有......一个变量的引用转换到一个变量($ {} project_path)的引用问题($ {workspace_loc})。

Obviously, it has problems translating a reference to a variable (${project_path}) inside ... a reference to a variable (${workspace_loc}).

您可以尝试在$ {} build_project变量,而不是

You could try the ${build_project} variable instead

${build_project:/build.xml}

我希望它能帮助。

I hope it helps.

这篇关于集成Ant构建器到Eclipse:错误&QUOT;变量引用空选择&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆