zDev - Tycho - OSS
  1. zDev - Tycho - OSS
  2. TYCHO-513

eclipse-repository shall use p2 metadata from local reactor module builds

    Details

    • Type: User Story User Story
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: None
    • Labels:
      None
    • Global Rank:
      3357

      Description

      Currently, the data flow for eclipse-repository is quite labyrinthine - and has hence certain limitations. The aim of this user story is to clean up the concept for how the results of the local reactor are consumed.

      In the current implementation, the p2 repository content of the eclipse-repository is obtained in the following way:

      • Product and category definitions in the eclipse-repository module are simply published into the p2 repository.
      • The jars of the features and bundle that are included (as described here) are copied and the p2 repository information is generated with the FeaturesAndBundlesPublisher. The problem here is, that the feature.jar doesn't contain any information about root files, so that this approach cannot take root files into account (see also the rejected proposal #3 here).

      In the current implementation, the really complicated situation is when a product is installed with the goal "materialize-products". In this case, the following p2 metadata and p2 artifact sources are used:

      • The metatada from the target platform resolution, computed when determining the build order. The artifact from the local reactor are pre-published into this metadata repository. Pre-published means that for some types (notably eclipse-feature), a limited "dependencies only" publisher is used. This concept has been spoiled in part when implementing TYCHO-188 - e.g. the feature jars are now also published, although they are not needed for build order computation (cf. 93c53b10). This data is propagated to eclipse-repository via the MetadataSerializable.
      • The p2 metadata and p2 artifacts repository created as the main (Maven) artifact of eclipse-repository.
      • The local Maven artifact repository as a p2 artifact repository, implemented in LocalArtifactRepository. If the eclipse-repository does not include all bundles from the local reactor, this is the way how the missing p2 artifacts from the local reactor are read. As a consequence, eclipse-repository currently only works (in this case) if Maven is called with [[install]].

      As part of this user story, the following things shall be changed:

      • The p2 metadata for each module is created in the module build itself. There is probably nothing to do for that because the maven-p2-plugin already generates the needed data and stores it in files p2content.xml and p2artifacts.xml
      • eclipse-repository mirrors the p2 data from the p2content.xml and p2artifacts.xml for the included features and bundles.
      • For features an plugins from the target platform, the p2 metadata is obtained via the MetadataSerializable as today. (However all p2 metadata about the local reactor will be filtered out when serializing.) The LocalArtifactRepository will also be used as p2 artifact repository for the non-local features and plugins. (Again, we may need some filtering.)

      These changes pave the way for the following improvements:

      • Root files can be published as part of the eclipse-feature module build (to be done in TYCHO-465). The p2 metadata about these root files will no longer be lost when including the feature in an eclipse-repository.
      • The coupling with the build order computation is significantly reduced.
      • mvn package should work properly for eclipse-repository.

        Issue Links

          Activity

          Hide
          Igor Fedorenko added a comment -

          I would like to see eclipse-repository packaging to use P2 metadata production/consumption API I described in TYCHO-506

          Show
          Igor Fedorenko added a comment - I would like to see eclipse-repository packaging to use P2 metadata production/consumption API I described in TYCHO-506
          Hide
          Tobias Oberlies added a comment -

          Initial cleanup increment committed: "Created new OSGi facade for p2 tools"
          Refactoring (prerequisite for mirroring) ready to be committed: "Call product and category publishers in process"

          Show
          Tobias Oberlies added a comment - Initial cleanup increment committed: "Created new OSGi facade for p2 tools" Refactoring (prerequisite for mirroring) ready to be committed: "Call product and category publishers in process"
          Hide
          Tobias Oberlies added a comment -

          Included Jan's feedback to change "Call product and category publishers in process": 7ec02ab

          @Jan: if you want to see the differences to the previously proposed patch, 7ec02ab is the combination of the first two commits in my github branch tycho513/change2 (see for example here)

          Show
          Tobias Oberlies added a comment - Included Jan's feedback to change "Call product and category publishers in process": 7ec02ab @Jan: if you want to see the differences to the previously proposed patch, 7ec02ab is the combination of the first two commits in my github branch tycho513/change2 (see for example here )
          Hide
          Tobias Oberlies added a comment -

          Please review the main commit of this user story: e5224b3. Feel free to ask questions, I'm aware it is quite a large change...

          Show
          Tobias Oberlies added a comment - Please review the main commit of this user story: e5224b3 . Feel free to ask questions, I'm aware it is quite a large change...
          Hide
          Tobias Oberlies added a comment -

          Rebased the main commit onto the latest master: 58d1b61. The only additional (notable) difference to e5224b3 is that MirrorApplicationServiceImpl now uses the StatusTool.

          Show
          Tobias Oberlies added a comment - Rebased the main commit onto the latest master: 58d1b61 . The only additional (notable) difference to e5224b3 is that MirrorApplicationServiceImpl now uses the StatusTool.
          Show
          Jan Sievers added a comment - committed https://github.com/sonatype/sonatype-tycho/commit/e58364edac98787da56b5df192628849da47ba98
          Hide
          Tobias Oberlies added a comment -

          Added internal documentation on the new data flow in the Tycho wiki: P2 Data Flow in Tycho

          Show
          Tobias Oberlies added a comment - Added internal documentation on the new data flow in the Tycho wiki: P2 Data Flow in Tycho

            People

            • Assignee:
              Jan Sievers
              Reporter:
              Tobias Oberlies
              Last Updated By:
              Jan Sievers
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: