在 Eclipse 外部运行 P2 Ant 任务
我的 ant 脚本在 Eclipse 中运行良好 这是其中的一部分:
<p2.composite.repository failOnExists="true">
<repository location="file:/${basedir}/compRepo" name="Repository description goes here" />
<add>
<repository location="http://url/Eclipse/repo/Galileo-3.5.1/" />
<repository location="http://another-url/Java/repo/4.0/" />
<repository location="${diag.location}" />
</add>
</p2.composite.repository>
但我希望 Hudson CI 服务器能够运行它,但是,无论我放入 ANT_HOME/lib 中的所有 jars,我都无法让这个任务在简单的命令行 ant 中运行。 .. 我遇到了这个错误:
C:\workspaces\workspace\project\junit.script\createCompRepo.xml:10: Problem: failed to create task or type p2.composite.repository
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
哪里定义了 p2 ant 任务?有没有办法在 Eclipse 之外运行它们? 非常感谢您的帮助! 安东尼
I got ant script running fine inside Eclipse
Here is a piece of it :
<p2.composite.repository failOnExists="true">
<repository location="file:/${basedir}/compRepo" name="Repository description goes here" />
<add>
<repository location="http://url/Eclipse/repo/Galileo-3.5.1/" />
<repository location="http://another-url/Java/repo/4.0/" />
<repository location="${diag.location}" />
</add>
</p2.composite.repository>
But I would like Hudson CI server to be able to run it, but, no matter all the jars I put in ANT_HOME/lib I can't get this task to run in a simple command line ant...
I got stuck with this error :
C:\workspaces\workspace\project\junit.script\createCompRepo.xml:10: Problem: failed to create task or type p2.composite.repository
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
Where are defined the p2 ant tasks ? Is there a way to run them outside Eclipse ?
Thank you very much for you help !
Anthony
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
通过阅读此线程和P2 Publisher 文档,它应该位于
org.eclipse.equinox.launcher_*.jar
仅用于
-jar
参数的 P2 任务示例(此处不是 ant 任务):P2 Ant 任务在此处 和 Eclipse 帮助。
OP Anthony43 在评论中添加:
但是 Andrew Niefer(PDE/Build、p2 和 Equinox 框架上的 Eclipse 提交者)添加:
martin jakubik 提到:
By reading this thread and the P2 Publisher documentation, it should be in
org.eclipse.equinox.launcher_*.jar
Example of a P2 task (not an ant task here) just for the
-jar
argument:The P2 Ant tasks are described here, and in the Eclipse help.
The OP Anthony43 adds in the comments:
But Andrew Niefer (Eclipse committer on PDE/Build, p2, & Equinox Framework) adds:
martin jakubik mentions:
我为此目的创建了一个小型 Ant 宏
I created a small Ant macro for that exact purpose
所有p2任务都需要eclipse运行时(如上面提到的eclipse帮助中明确指出的),所以你肯定需要使用eclipse。
解决这个问题的唯一方法是分析 Eclipse 代码,提取所需内容并用它创建您自己的构建系统。
All the p2 tasks NEED the eclipse runtime (as explicitly stated in the eclipse help mentioned above), so you definitely need to use eclipse.
The only way to get round of it would be to analyze the eclipse code, extract what is needed and create your own build system with it.
只是为了完成 Jarek Przygódzki 的示例,这是我的解决方案,使用他的 ant 文件。我不太熟悉使用ant,所以可能有优化的潜力。
这种方法在没有 GUI 的服务器上无头使用,但我必须安装 eclipse。使用 apt-get 安装不起作用,因此最好手动安装(下载并解压)。
第一个 antfile:
第二个 Antfile,名为 addCompositeInternal.ant
Just to complete the example of Jarek Przygódzki here is my solution, using his ant-file. I'm not well versed in using ant, so there might be potential for optimisation.
This aproach is used headless on a server without GUI, nevertheless I had to install eclipse. Installation with apt-get wasn't working, so it's better to install manual (download and untar).
First antfile:
Second Antfile, named addCompositeInternal.ant