运行Eclipse之外P2 Ant任务 [英] Running P2 Ant tasks outside Eclipse

查看:130
本文介绍了运行Eclipse之外P2 Ant任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行Eclipse内部精细ant脚本
这里是一块吧:

 < p2.composite.repository failOnExists =真正的>
            <库位置=文件:/ $ {BASEDIR} / COM prePONAME =库介绍到这里/>
            <添加>
                <库位置=HTTP://url/Eclipse/repo/Galileo-3.5.1//>
                <库位置=HTTP://another-url/Java/repo/4.0//>
                <库位置=$ {} diag.location/>
            < /添加>
        < /p2​​.composite.repository>

不过,我想哈德森CI服务器能够运行,但是,不管一切,我把ANT_HOME / lib下我不能让这个任务在一个简单的命令行运行蚂蚁的罐子...
我被困这个错误:

  C:\\工作区\\工作区\\项目\\ junit.script \\ createCom prepo.xml:10:问题:无法创建任务或类型p2.composite.repository
原因:这个名字是不确定的。
操作:检查拼写。
操作:检查所有的自定义任务/类型已经被宣布。
操作:检查任何与LT; presetdef> /< macrodef>声明发生。

在哪里定义的P2 Ant任务?有没有一种办法的Eclipse外面跑呢?
非常感谢您的帮助!
安东尼


解决方案

通过阅读此线程 P2发布文档,应该在 org.eclipse.equinox .launcher _ *。JAR

在P2的任务(这里没有一个Ant任务),只为 -jar 参数的例子:

  Java的罐子< targetProductFolder方式> /plugins/org.eclipse.equinox.launcher _ *罐子
  - 应用org.eclipse.equinox.p2.publisher.UpdateSitePublisher
 -metadataRepository文件:/<有的地点> /存储库
 -artifactRepository文件:/<有的地点> /存储库
 -source /<位置与site.xml的>
 -configs gtk.linux.x86
 -com preSS
 -publishArtifacts

借助 P2 Ant任务都在这里描述,并在<一个href=\"http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_repositorytasks.htm\">Eclipse帮助。


在OP Anthony43 增加在评论:


  

我只是想和P2任务定义运行Ant目标,Eclipse之外。结果
  我发现我应该使用 antRunner ,使用这样的命令行:


  ./日食-vm /opt/sun-java2-6.0/bin/java -nosplash \\
-data $ {java.io.tmpdir} /工作区-consolelog \\
- 应用org.eclipse.ant.core.antRunner \\
-f /path/to/scripts/partialMirrorFromRepo.xml

安德鲁Niefer (PDE上/建造,P2和放大器Eclipse提交;春分框架)补充道:


  

P2任务需要OSGi环境内运行,并且不会在正常运行蚂蚁工作。结果
  这就是为什么你需要使用 org.eclipse.ant.core.antRunner 应用程序。结果
  与Java的罐子launcher.jar开始仅仅是调用Eclipse可执行文件的替代方法。



马丁​​jakubik 提到:


  

我也喜欢看,我可以剪切和放命令;粘贴并把一切融合在一起结果
  我使用的是:


  Java的罐子&LT; Eclipse的安装目录方式&gt; \\日食\\插件\\ org.eclipse.equinox.launcher _ *罐子 - 应用org.eclipse.ant.core.antRunner。


  

请注意,我想不出什么&LT; targetProductFolder&GT; 是,所以我用&LT; Eclipse的安装...&GT; 代替。


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

解决方案

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:

java -jar <targetProductFolder>/plugins/org.eclipse.equinox.launcher_*.jar
 -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher
 -metadataRepository file:/<some location>/repository
 -artifactRepository file:/<some location>/repository
 -source /<location with a site.xml>
 -configs gtk.linux.x86
 -compress 
 -publishArtifacts

The P2 Ant tasks are described here, and in the Eclipse help.


The OP Anthony43 adds in the comments:

I just want to run an an ant target with p2 taskdefs, outside of eclipse.
I found out that I should use antRunner, using such a command line :

./eclipse -vm /opt/sun-java2-6.0/bin/java -nosplash \
-data ${java.io.tmpdir}/workspace -consolelog       \
-application org.eclipse.ant.core.antRunner         \
-f /path/to/scripts/partialMirrorFromRepo.xml 

But Andrew Niefer (Eclipse committer on PDE/Build, p2, & Equinox Framework) adds:

The p2 tasks need to be run inside an osgi environment and won't work in a normal ant run.
That is why you need to use the org.eclipse.ant.core.antRunner application.
Starting with "java -jar launcher.jar" is just an alternate method to invoking the eclipse executable.


martin jakubik mentions:

I would have liked to see a command that I could cut&paste and that put everything together.
What I used was:

java -jar <eclipse-install-directory>\eclipse\plugins\org.eclipse.equinox.launcher_*.jar -application org.eclipse.ant.core.antRunner. 

Note that I could not figure out what <targetProductFolder> was, so I used <eclipse-install...> instead.

这篇关于运行Eclipse之外P2 Ant任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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