Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] p2 publication queries

Thanks Eric. We'll take a look.

Glyn
On 11 Jun 2010, at 11:59, Eric Gwin wrote:

> Glyn,
> 
> FWIW. Our project builds directly from ant, and though there aren't ant 
> tasks we can use (because they'd need to be run from within Eclipse) we 
> do utilize the publisher to generate p2 repositories. All you really 
> need is paths to the launcher and publisher jars, and can invoke them 
> using the "java" task. It isn't as pretty, but it does work. I'll post 
> the target we use below. I hope it helps you out in the meantime.
> 
> -Eric
> 
>        <property name="p2.publisher.jar" 
> value="org.eclipse.equinox.p2.publisher_*.jar"/>
>        <property name="p2.launcher.jar" 
> value="org.eclipse.equinox.launcher_*.jar"/>
> 
>    <target name="publish-p2-child" if="do.composite">
>        <echo message="java.home        ='${java.home}'"/>
>        <echo message="p2.SDK.plugin.dir='${p2.SDK.plugin.dir}'"/>
>        <echo message="p2.launcher.jar  ='${p2.launcher.jar}'"/>
>        <echo message="p2.publisher.jar ='${p2.publisher.jar}'"/>
>        <echo message="-----"/>
>        <echo message="p2.repos.dir     ='${p2.repos.dir}'"/>
>        <echo message="p2.repos.url     ='${p2.repos.url}'"/>
>        <!-- Metadata generator apparently doesn't rebuild the artifact 
> and content xml files if they already exist -->
>        <mkdir dir="${p2.repos.dir}"/>
>        <delete  failonerror="false">
>            <fileset dir="${p2.repos.dir}" includes="artifact*.*, 
> content*.*"/>
>        </delete>
>        <java classname="org.eclipse.equinox.launcher.Main" fork="true" 
> timeout="10800000" taskname="p2"
>            jvm="${java.home}/bin/java" failonerror="false" 
> maxmemory="256m">
>            <classpath>
>                <fileset dir="${p2.SDK.plugin.dir}"
>                    includes="${p2.launcher.jar},
>                              ${p2.publisher.jar}"/>
>                <pathelement location="${p2.SDK.plugin.dir}" />
>            </classpath>
>            <arg line=" -application 
> org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher" />
>            <arg line=" -metadataRepository ${p2.repos.url}" />
>            <arg line=" -artifactRepository ${p2.repos.url}" />
>            <arg line=" -source ${p2.repos.dir}" />
>            <arg line=" -compress -publishArtifacts -configs all" />
>        </java>
>    </target>
> 
> 
> Glyn Normington wrote:
>> We are most interested in the p2.publish.featuresAndBundles task. Later we may also need a way to resolve dependencies from p2, but that is lower priority.
>> 
>> Glyn
>> On 11 Jun 2010, at 02:49, Pascal Rapicault wrote:
>> 
>> 
>>>> In addition, we are wanting to use the p2 ant tasks and we can't get them going (most nested stack trace from v3.5.2 below, v3.6RC4 fails and gives the impression an OSGi environment needs to be set up in advance). Is it necessary to set up some kind of OSGi environment prior to using these ant tasks? Are there examples of the use of these ant tasks, preferably in live Eclipse projects?
>>>> 
>>> 	The Eclipse SDK itself uses some / most of these tasks. They are unfortunately bound to Ant and OSGi because p2 is written using OSGi and we never really had a request / need to decouple them from OSGi.  I'm not quite sure how tight is our coupling with OSGi but I think it is not too bad especially since we stopped using OSGi services everywhere.
>>> 	Which tasks are you interested in?
>>> 
>>> 
>>>> Many thanks,
>>>> Glyn
>>>> 
>>>> [1] http://www.eclipse.org/forums/index.php?t=msg&th=169631&start=0
>>>> [2] http://eclipse.org/virgo/
>>>> [3] http://wiki.eclipse.org/Virgo/Source
>>>> [4] https://bugs.eclipse.org/bugs/show_bug.cgi?id=311697#c1
>>>> 
>>>> java.lang.NullPointerException
>>>>      at org.eclipse.equinox.p2.publisher.Publisher.loadArtifactRepository(Publisher.java:142)
>>>>      at org.eclipse.equinox.p2.publisher.Publisher.createArtifactRepository(Publisher.java:104)
>>>>      at org.eclipse.equinox.internal.p2.publisher.ant.AbstractPublishTask.initializeRepositories(AbstractPublishTask.java:93)
>>>>      at org.eclipse.equinox.internal.p2.publisher.ant.FeaturesAndBundlesPublisherTask.execute(FeaturesAndBundlesPublisherTask.java:29)
>>>>      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>>>      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>>>>      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>      at java.lang.reflect.Method.invoke(Method.java:597)
>>>>      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>>>>      at org.apache.tools.ant.Task.perform(Task.java:348)
>>>>      at org.apache.tools.ant.Target.execute(Target.java:357)
>>>>      at org.apache.tools.ant.Target.performTasks(Target.java:385)
>>>>      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
>>>>      at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
>>>>      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
>>>>      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
>>>>      at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:289)
>>>>      at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:208)
>>>>      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>>>      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>>>>      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>      at java.lang.reflect.Method.invoke(Method.java:597)
>>>>      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>>>>      at org.apache.tools.ant.Task.perform(Task.java:348)
>>>>      at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
>>>>      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>>>      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>>>>      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>      at java.lang.reflect.Method.invoke(Method.java:597)
>>>>      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>>>>      at org.apache.tools.ant.Task.perform(Task.java:348)
>>>>      at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
>>>>      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>>>      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>>>>      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>      at java.lang.reflect.Method.invoke(Method.java:597)
>>>>      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>>>>      at org.apache.tools.ant.Task.perform(Task.java:348)
>>>>      at org.apache.tools.ant.Target.execute(Target.java:357)
>>>>      at org.apache.tools.ant.Target.performTasks(Target.java:385)
>>>>      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
>>>>      at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
>>>>      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>>>>      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
>>>>      at org.apache.tools.ant.Main.runBuild(Main.java:758)
>>>>      at org.apache.tools.ant.Main.startAnt(Main.java:217)
>>>>      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
>>>>      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
>>>> _______________________________________________
>>>> p2-dev mailing list
>>>> p2-dev@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/p2-dev
>>>> 
>>> _______________________________________________
>>> p2-dev mailing list
>>> p2-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/p2-dev
>>> 
>> 
>> _______________________________________________
>> p2-dev mailing list
>> p2-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/p2-dev
>> 
>> 
> 
> -- 
> -Eric
> 
> Oracle <http://www.oracle.com>
> Eric Gwin | Senior Software Developer
> Phone: +613 288 4622 <tel:+613%20288%204622> | | Fax: +613 2382818 
> <fax:+613%202382818> | | Mobile: +613 8582347 <tel:+613%208582347>
> Oracle Java Server Technologies
> ORACLE Canada | 45 O'Connor St., Ottawa, Ontario | K1P 6L2
> Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
> developing practices and products that help protect the environment
> 
> _______________________________________________
> p2-dev mailing list
> p2-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/p2-dev



Back to the top