Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 2, 2025

Overview

This PR adds a new p2-manager goal to the tycho-p2-extras-plugin that provides a convenient way to maintain, update, and manage the integrity of public P2 update sites. The mojo wraps the P2 Manager application from JustJ Tools and offers a much simpler and more validated configuration compared to using the eclipse-run goal directly.

Problem

Currently, using the P2 Manager from Maven requires a complex setup using the eclipse-run goal. This approach has several drawbacks:

  • Requires extensive knowledge of the P2 Manager application
  • Configuration is mostly a large block of text that is not validated
  • Easy to make mistakes with parameter names and values
  • No IDE support for configuration parameters
  • Poor discoverability of available options

Solution

This PR introduces a new tycho-p2-extras:p2-manager mojo that:

  • Sources the P2 Manager application from https://download.eclipse.org/justj/tools/updates/
  • Provides properly typed and validated Maven parameters for all P2 Manager options
  • Offers IDE auto-completion and parameter validation
  • Follows the same pattern as the SBOM generator mojo for consistency

Features

The P2 Manager helps with:

  • Promoting builds to update sites (nightly, milestone, or release)
  • Generating composite repositories
  • Managing repository history and retention policies
  • Creating browsable HTML pages for your update sites
  • Maintaining repository integrity

Example Usage

<plugin>
    <groupId>org.eclipse.tycho.extras</groupId>
    <artifactId>tycho-p2-extras-plugin</artifactId>
    <version>${tycho-version}</version>
    <executions>
        <execution>
            <id>promote-build</id>
            <goals>
                <goal>p2-manager</goal>
            </goals>
            <configuration>
                <root>${project.build.directory}/updatesite</root>
                <promote>file:${project.build.directory}/repository</promote>
                <timestamp>${maven.build.timestamp}</timestamp>
                <type>nightly</type>
                <retain>7</retain>
            </configuration>
        </execution>
    </executions>
</plugin>

Changes

  • New Mojo: P2ManagerMojo.java with comprehensive parameter mapping from the P2Manager application
  • Documentation:
    • Updated site.xml to link the new mojo under "Creating update sites using category.xml"
    • Added new section in Category.md with usage examples and parameter descriptions
    • Added entry to RELEASE_NOTES.md announcing the new feature
  • Parameters: All P2Manager application parameters are properly mapped including:
    • Basic: root, verbose, label, type, retain, timestamp
    • Promotion: promote, promoteProducts, buildUrl
    • UI customization: favicon, titleImage, bodyImage
    • Filtering: iuFilterPattern, primaryIUFilterPattern, excludedCategoriesPattern
    • Advanced: simrelAlias, bree, summary, mappings, etc.

Testing

  • Plugin compiles successfully with Java 21
  • Mojo is properly registered and discoverable via mvn help:describe
  • Parameter validation works correctly (e.g., required root parameter)
  • Can be invoked from command line and in pom.xml configurations

Fixes #[issue-number]

Original prompt

Create a new mojo for the P2 manager

Currently if one wants to use the P2 Manager (https://eclipse.dev/justj/?page=tools) from maven it requires a quite complex setup using the eclipse-run goal.
While this works it has the drawback of require a lot of kowledge and configuration is mostly a large block of text that is not validated and easy to get wrong.

Instead we should supply a mojo that wrapps the application call like we did for the SBOM generator (tycho-sbom-plugin/src/main/java/org/eclipse/tycho/sbom/plugin/GeneratorMojo.java):


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Copilot AI changed the title Create a new mojo for the P2 manager Currently if one wants to use the P2 Manager (https://eclipse.dev/justj/?page=tools) from maven it requires a quite complex setup using the eclipse-run goal. While this works it has the drawback of require a lot of... Add P2 Manager Mojo to tycho-p2-extras-plugin Oct 2, 2025
Copilot AI requested a review from laeubi October 2, 2025 05:29
@laeubi
Copy link
Member

laeubi commented Oct 2, 2025

FYI @merks

@laeubi
Copy link
Member

laeubi commented Oct 9, 2025

@waynebeaton again a request to provide something similar we have, but only as a rough concept.. generating a whole new thing! Obviously not just completely trivial even if repetitive of course. AI adds copyright header that claims I own the copyright.. Maybe we need some "AI Generated Content" or generic "The Eclipse/Tycho/.. Project team" Copyright header to used... would be good to have a general recommendation I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants