gpt4 book ai didi

eclipse - 在 Eclipse 之外运行 P2 Ant 任务

转载 作者:行者123 更新时间:2023-12-04 03:17:36 24 4
gpt4 key购买 nike

我在 Eclipse 中运行良好的 ant 脚本
这是其中的一部分:

<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 中的所有 jar,我都无法在简单的命令行 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 之外运行它们?
非常感谢您的帮助!
安东尼

最佳答案

通过阅读 this threadP2 Publisher documentation ,应该在 org.eclipse.equinox.launcher_*.jar
仅用于 -jar 的 P2 任务示例(此处不是 ant 任务)争论:

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

P2 Ant tasks are described here ,并在 Eclipse help .

OP Anthony43在评论中添加:

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

但是 Andrew Niefer (PDE/Build、p2 和 Equinox 框架上的 Eclipse 提交者)补充说:

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提到:

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 - 在 Eclipse 之外运行 P2 Ant 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2327393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com