Bonjour!
Have few questions regarding p2 mirror in Product Builds.
Context:
-
Same behavior on Eclipse 3.6.1 and 3.7.0M5
-
Created a new empty workspace (Target Platform is the
default Eclipse Running Platform)
-
Created a simple dummy bundle (Bundle B) which
only has 1 simple Import-Package: org.apache.tools.ant;resolution:=optional
-
Created a simple dummy product (Product P) which only includes
the Bundle B in his list of plugins.
-
Created a copy of /org.eclipse.pde.build/templates/headless-build/build.properties
and customized it appropriately (and added p2.gathering=true)
-
Called ${eclipse.pdebuild.scripts}/productBuild/productBuild.xml
to build the Product P
-
This created the standard output:
o buildRepo/
o features/
o I.TestBuild/
o assemble.org.eclipse.pde.build.container.feature.all.xml
o assemble.org.eclipse.pde.build.container.feature.p2.xml
o assemble.org.eclipse.pde.build.container.feature.xml
o final*.properties
o package.org.eclipse.pde.build.container.feature.all.xml
o package.org.eclipse.pde.build.container.feature.xml
-
The complete ouput in the buildRepo/plugins contains
the following artifacts:
o org.apache.ant_1.7.1.v20100518-1145
(** folder **)
o bundle_A_1.0.0.201103031045.jar
o org.eclipse.equinox.launcher_1.2.0.v20110124-0830.jar
o org.eclipse.osgi_3.7.0.v20110124-0830.jar
-
My questions/concerns are regarding org.apache.ant
artifact. I understand why it has been mirrored, but my question is regarding
the fact that it has been mirrored as a folder. In fact, it has been mirrored
from my Eclipse Install which has it as a folder since it has been “Installed/Provisioned”.
So the build is mirroring an “Installed” artifact to an IU in its
original format (folder in this case). And having folders in a consumable p2
repo could lead to the following issue when mirroring or provisioning thru http:
Installation
failed.
[exec] An error occurred
while collecting items to be installed
[exec] session context
was:(profile=""
phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=,
action="">
[exec] Artifact
osgi.bundle,org.apache.ant,1.7.1.v20100518-1145 is a folder but the repository
is an archive or remote location.
-
The mirror step in question is located in the generated
assemble.org.eclipse.pde.build.container.feature.p2.xml and looks like this:
<p2.mirror>
<slicingOptions includeNonGreedy="false" />
<source location="${p2.build.repo}" />
<source location="file:/C:/e3.7M5/eclipse/configuration/../p2/org.eclipse.equinox.p2.engine/profileRegistry/EquinoxProvisioningUI.profile/" optional="true" kind="metadata" />
<source location="file:/C:/e3.7M5/eclipse/configuration/org.eclipse.osgi/bundles/125/data/listener_1925729951/" optional="true" kind="metadata" />
<source location="file:/C:/e3.7M5/eclipse/" optional="true" kind="artifact" />
<source location="file:/C:/e3.7M5/eclipse/configuration/org.eclipse.osgi/bundles/125/data/listener_1925729951/" optional="true" kind="artifact" />
<source location="file:/C:/e3.7M5/eclipse/p2/org.eclipse.equinox.p2.core/cache/" optional="true" kind="artifact" />
<destination location="${p2.build.repo}" kind="metadata" />
<destination location="${p2.build.repo}" kind="artifact" />
<iu id="product_P.product" version="1.0.0" />
</p2.mirror>
-
Note that, if org.apache.ant is included in the list of
plugins of Product P, then org.apache.ant will appear as a *jar* in
buildRepo/plugins.
Question 1)
-
Should the mirror operation in the build be modified so
it always output to a defined target p2 repo format (in this case, jar)? Or is
there a way to do it already? Or is there something that should be done
differently?
Question 2)
-
Would it make sense to allow support of all
<slicingOptions> in the above p2.mirror task from the build? That way, the
output p2 repo could avoid including optional dependencies (if not wanted).
Currently, it seems to only support includeNonGreedy="false" (hardcoded in /org.eclipse.pde.build/pdebuildsrc/org/eclipse/pde/internal/build/P2ConfigScriptGenerator.java
line 303).
Thanks for your suggestions/help!
Regards,
Sébastien