Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cbi-dev] What is copied by CBI aggregator and why?

Hi everybody,

I just started to use CBI aggregator (headless from the precompiled archives) and I think I got the main ideas of how to work with it. However, the validation and in general the behavior of the p2 planner puzzles me. My goal is to create a maven repository containing all (p2-)dependencies of one of my projects as maven artifacts. Please allow me to introduce the rather small aggregator model I am using.

<?xml version="1.0" encoding="UTF-8"?>
<aggregator:Aggregation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:aggregator="http://www.eclipse.org/cbi/p2repo/2011/aggregator/1.1.0"; label="dependency repo" buildRoot="../m2Repo" packedStrategy="UNPACK" type="M" mavenResult="true" versionFormat="MavenRelease">
  <validationSets label="Henshin">
    <contributions label="Henshin">
      <repositories location="http://download.eclipse.org/modeling/emft/henshin/updates/nightly";>
        <bundles name="org.eclipse.emf.henshin.interpreter"/>
        <bundles name="org.eclipse.emf.henshin.model"/>
      </repositories>
    </contributions>
    <contributions label="Eclipse">
    <repositories location="http://download.eclipse.org/releases/2019-03";>
        <bundles name="org.eclipse.emf.ecore.xmi"/>
    </repositories>
    </contributions>
  </validationSets>
  <configurations architecture="x86_64"/>
</aggregator:Aggregation>


The Henshin bundles are the direct dependencies of my project. Therefore, I selectively choose to only copy the ones I need from the respective p2 update site. Henshin itself is based on other parts of the Eclipse Modeling Framework (EMF) which in turn needs some other Eclipse bundles. That's what the Eclipse contribution is about. As you can see, there is a single bundle definition for the associated repository. From the documentation in the wiki I would have expected that only this single bundle should be copied to the output repository.

Defining Bundle components allows addition of individual Eclipse bundles to the aggregation to be specified (rather than the complete contents of a given Mapped Repository).

However, it seems like all transitive dependencies of the specified Henshin bundles are copied. What is more, it doesn't even matter which specific dependency I add as a bundle definition. Whatever I specify there I get the same 24 bundles copied to created repository. Using this repo, my projects builds (with a Maven pom-first approach). Interestingly, the repository contains two bundles which are not showing up in the dependency tree build by Maven (com.ibm.icu and a.jre.javase). Unfortunately, I could not find a way to let CBI aggregator tell me why these bundles were added. Even in DEBUG logLevel no information about the dependencies are revealed.

On the other hand, removing all bundle definitions for the Eclipse repository I would expect the whole repository to be copied. Instead an exception is thrown:

Build failed! Exception was org.eclipse.core.runtime.CoreException: Cannot complete the install because some dependencies are not satisfiable Software being installed: validationSet_Henshin 1.0.0 Cannot satisfy dependency: mappedRepo_download.eclipse.org_releases_2019-03 1.0.0 depends on: org.eclipse.equinox.p2.iu; org.eclipse.emf.rap.sdk.feature.group 0.0.0 Cannot satisfy dependency: mappedRepo_download.eclipse.org_releases_2019-03 1.0.0 depends on: org.eclipse.equinox.p2.iu; org.eclipse.platform.feature.group 0.0.0 Cannot satisfy dependency: org.eclipse.emf.rap.sdk.feature.group 2.17.0.v20190226-1307 depends on: org.eclipse.equinox.p2.iu; org.eclipse.platform.feature.group 0.0.0 Cannot satisfy dependency: validationSet_Henshin 1.0.0 depends on: org.eclipse.equinox.p2.iu; mappedRepo_download.eclipse.org_releases_2019-03 [1.0.0,1.0.0]

I guess, this is caused by the aggregator not considering anything in that repository (instead of everything as I expected). The same happens when I add an exclusion on the seemingly unnecessary com.ibm.icu bundle to the above model.

<mapRules xsi:type="aggregator:ExclusionRule" name="com.ibm.icu"/>


Overall the following questions go around in my head:
a) What would one need to specify to get all bundles of a repository?
b) Why do I get all dependencies when I specify a single bundle? Can I expect the aggregator to always at least copy all the dependencies? c) Is there a way to show the dependency tree which is used during validation?

Any helpful explanations are appreciated. Maybe I just overlooked relevant parts of the documentation.

Best wishes,
Stefan







Back to the top