Running P2 Ant tasks outside Eclipse

前端 未结 4 719
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-28 09:25

I got ant script running fine inside Eclipse Here is a piece of it :


            

        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-28 10:12

    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 /plugins/org.eclipse.equinox.launcher_*.jar
     -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher
     -metadataRepository file://repository
     -artifactRepository file://repository
     -source /
     -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\plugins\org.eclipse.equinox.launcher_*.jar -application org.eclipse.ant.core.antRunner. 
    

    Note that I could not figure out what was, so I used instead.

提交回复
热议问题