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

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

问题描述

 < p2。 composite.repository failOnExists =true> 
< repository location =file:/ $ {basedir} / compReponame =存储库描述在这里/>
< 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服务器能够运行它,但不管所有的jar我放入ANT_HOME / lib我不能得到这个任务运行在一个简单的命令行ant ...
我被卡住了这个错误:

  C:\workspaces\workspace\project\junit.script\createCompRepo.xml:10:问题:无法创建任务或键入p2.composite.repository 
原因:名称未定义。
动作:检查拼写。
操作:检查是否已声明任何自定义任务/类型。
操作:检查任何< presetdef> /< macrodef>声明已经发生。

在哪里定义了p2 ant任务?有没有办法在Eclipse之外运行它们?
非常感谢你的帮助!
Anthony

解决方案

阅读这个线程 P2 Publisher文档,它应该在 org.eclipse.equinox.launcher _ *。jar





 





$ b p> java -jar< targetProductFolder> /plugins/org.eclipse.equinox.launcher _ *。jar
-application org.eclipse.equinox.p2.publisher.UpdateSitePublisher
- metadataRepository文件:/< some location> / repository
-artifactRepository file:/< some location> / repository
-source /< location with a site.xml>
-configs gtk.linux.x86
-compress
-publishArtifacts

P2 Ant任务在此描述,而在 Eclipse帮助






OP Anthony43 < a>在评论中添加:


我只想运行一个蚂蚁目标与p2 taskdefs,在eclipse之外。

我发现我应该使用 antRunner ,使用这样的命令行:




  ./ 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 / pa rtialMirrorFromRepo.xml

但是(Eclipse提交者在PDE / Build,p2,& Equinox框架)补充说:


p2任务需要在osgi环境中运行,不能在正常的ant运行

这就是为什么你需要使用 org.eclipse.ant.core.antRunner 应用程序。

以java -jar launcher.jar开头只是调用eclipse可执行文件的另一种方法。







martin jakubik 提到:



<我将会喜欢看到一个可以剪切并将其放在一起的命令。

我使用的是:




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




请注意,我无法弄清楚什么是 < targetProductFolder> 是,所以我使用< eclipse-install ...>



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天全站免登陆