Skip to content

Fix several issues with the P2ManagerMojo #6095#6112

Merged
laeubi merged 1 commit into
eclipse-tycho:mainfrom
ptziegler:issue6095
Jul 16, 2026
Merged

Fix several issues with the P2ManagerMojo #6095#6112
laeubi merged 1 commit into
eclipse-tycho:mainfrom
ptziegler:issue6095

Conversation

@ptziegler

@ptziegler ptziegler commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Trying to start the P2 Manager for promoting a repository using the P2ManagerMojo currently fails for the following reason:

  • The URL for fetching the JustJ tools doesn't point to a valid p2 repository. This is now customizable via already existing
    managerRepository property, where consumers can specify the update site to use. By default, the latest JustJ tools are used.

  • In order to launch the JustJ tools, a version of the Eclipse IDE needs to be specified as well. This can now be customized via the new eclipseRepository property and falls back to the "latest" release by default.

  • The relative parameter is required. If not set, updates is used as relative path.

  • The P2 Manager application must require the org.eclipse.justj.p2 and the org.apache.felix.scr plug-ins, instead of the non-existing org.eclipse.justj.p2.feature.group feature.

Closes #6095

@ptziegler

Copy link
Copy Markdown
Contributor Author

This is the configuration I used locally for testing:

<build>
	<plugins>
		<plugin>
			<groupId>org.eclipse.tycho.extras</groupId>
			<artifactId>tycho-p2-extras-plugin</artifactId>
			<version>${tycho-version}</version>
			<executions>
				<execution>
					<id>promote-build</id>
					<phase>post-integration-test</phase>
					<goals>
						<goal>p2-manager</goal>
					</goals>
					<configuration>
						<repositories>
							<repository>
								<id>justj.tools.repo</id>
								<layout>p2</layout>
								<url>https://download.eclipse.org/justj/tools/updates/nightly/latest</url>
							</repository>
							<repository>
								<id>eclipse.repo</id>
								<layout>p2</layout>
								<url>https://download.eclipse.org/releases/latest</url>
							</repository>
						</repositories>
						<root>${project.build.directory}/updatesite</root>
						<promote>${project.basedir}/../repository/target/repository</promote>
						<timestamp>${maven.build.timestamp}</timestamp>
						<type>nightly</type>
					</configuration>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

...which then produced this (local) update site.
image

EclipseWorkspace<?> workspace = workspaceManager.getWorkspace(repository.getURL(), this);
application.addBundle("org.eclipse.justj.p2");
application.addBundle("org.apache.felix.scr");
EclipseWorkspace<?> workspace = workspaceManager.getWorkspace(locations.get(0).getURL(), this);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the one thing I'm still not happy about. Would a "composite" key of all URL be better?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a bit unfortunate to require multiple URLs anyways. @merks I wonder if the justj could get a repository reference to its required eclipse release?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle, it would also work to have two parameters in the Mojo. One for the Eclipse repo and one for the JustJ tools. The workspace would then be selected wrt. to the JustJ Tools URL.

To be honest, I'm don't fully understand yet, to what extent the URL is used when creating the workspace. So I can't say what the best solution would be.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now split this up into two properties. One for the JustJ tools and one for the Eclipse IDE.


public static final String ECLIPSE_LATEST = "https://download.eclipse.org/releases/2025-12/";

public static final String JUST_TOOLS_NIGHTLY = "https://download.eclipse.org/justj/tools/updates/nightly/latest";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be not in Tycho constants (as its usually not needed elsewhere).

@merks by the way is this considered the right default? Is there any plan to have a stable release somehow?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I've moved the constant to the P2ManagerMojo.

@laeubi

laeubi commented Jun 9, 2026

Copy link
Copy Markdown
Member

This is the configuration I used locally for testing:

Do you think it would be feasible to have a minimal integrationtest for using this mojo?
For such higher level things I found it often useful to provide for example a demo here: https://github.com/eclipse-tycho/tycho/tree/main/demo and then reference it in the https://github.com/eclipse-tycho/tycho/blob/main/tycho-its/src/test/java/org/eclipse/tycho/test/DemoTest.java

@ptziegler

Copy link
Copy Markdown
Contributor Author

Do you think it would be feasible to have a minimal integrationtest for using this mojo?

Absolutely. But that'll have to wait for tomorrow. I originally wanted to only have a quick look and already spent more time on it than I originally had planned. 😅

@laeubi

laeubi commented Jun 9, 2026

Copy link
Copy Markdown
Member

Do you think it would be feasible to have a minimal integrationtest for using this mojo?

Absolutely. But that'll have to wait for tomorrow. I originally wanted to only have a quick look and already spent more time on it than I originally had planned. 😅

No problem, thanks for looking into this!

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Test Results

1 056 files  1 056 suites   5h 4m 41s ⏱️
1 411 tests 1 388 ✅ 21 💤 0 ❌ 2 🔥
4 225 runs  4 157 ✅ 66 💤 0 ❌ 2 🔥

For more details on these errors, see this check.

Results for commit 2a64f5a.

♻️ This comment has been updated with latest results.

@ptziegler

Copy link
Copy Markdown
Contributor Author

I've added a small demo that mimics our project structure and which should produce something like this:

image

Trying to start the P2 Manager for promoting a repository using the
P2ManagerMojo currently fails for the following reason:

- The URL for fetching the JustJ tools doesn't point to a valid p2
repository. This is now customizable via already existing
`managerRepository` property, where consumers can specify the update
site to use. By default, the latest JustJ tools are used.

- In order to launch the JustJ tools, a version of the Eclipse IDE needs
to be specified as well. This can now be customized via the new
`eclipseRepository` property and falls back to the "latest" release by
default.

- The `relative` parameter is required. If not set, `updates` is used as
relative path.

- The P2 Manager application must require the `org.eclipse.justj.p2` and
the `org.apache.felix.scr` plug-ins, instead of the non-existing
`org.eclipse.justj.p2.feature.group` feature.

Closes eclipse-tycho#6095
@ptziegler ptziegler changed the title Improve start-up handling of P2Manager in P2ManagerMojo #6095 Fix several issues with the P2ManagerMojo #6095 Jun 19, 2026
@laeubi

laeubi commented Jun 19, 2026

Copy link
Copy Markdown
Member

@ptziegler thanks for the update. I'm just waiting for feedback from @merks about if a reference would be feasible (so we only need always one update site) and about if there is any plan to have a latest stable release url.

@merks

merks commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

I'm not sure the proposal for I should provide feedback...

@laeubi

laeubi commented Jun 19, 2026

Copy link
Copy Markdown
Member

I'm not sure the proposal for I should provide feedback...

  1. Is https://download.eclipse.org/justj/tools/updates/nightly/latest the site to use or is there any stable "latest" release site one can use
  2. It seems that one can not install the P2 manager from https://download.eclipse.org/justj/tools/updates/nightly/latest but requiring (a matching?) https://download.eclipse.org/releases/<some release> additionally. It would be good to either have a self-contained site (e.g. I think it mostly requires some of the P2 bundles) or one that includes a reference (or a composite site?) to whatever the P2 manager is build with.

That way we could make it much more convenient and easier to use.

@merks

merks commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Note that the repository is really tiny and even the zip of the whole repository it is 857,339 bytes:

image

So I don't want to bloat this with copied transitive dependencies.

I'm also not a fan in general of repository references, in my experience they cause problem problems than they solved.

So I neither wish to copy transitive dependencies not sprinkle in a specific reference to the underlying existing update site.

In principle I could provide an update site that composes

And while that might seem convenient, I wonder if it really is convenient in general?

If folks wish to redirect/modify/mirror the update sites that are used, is it more convenient to mirror and update the two sites or to mirror and update the two sites plus a composite site which then need to compose the two other mirrored/updated sites? I don't know. Maybe @ptziegler as a better sense for the benefit?

My vague sense is that it's better to acknowledge/recognize there are two sites involved and that the client can configure either or both of these sites. E.g., I would hope the p2 manager can continue to run with Java 21 for quite some time, even though the Platform is likely to require Java 25 in the fall...

@ptziegler

Copy link
Copy Markdown
Contributor Author

Maybe @ptziegler as a better sense for the benefit?

From my experience, setting up the update site is something one only ever does once and then never touches again. And whether I have to specify one or two update sites really doesn't make a difference to me. The error message was also very clear regarding the missing RCP artifacts.

I would actually argue that it's preferrable to have the Eclipse artifacts used for promotion configurable. Just for the unlikely event that there is an incompatibility. Or in my case, where I want use a proxy repository, rather than contacting the official update site directly.

Generally, I don't like to build against a nightly build, because then you lose reproducibility. But the JustJ Tools look very stable, so I don't think it really matters here. And even if reproducibility is required, I could again simply create a proxy repository from a specific nightly build.

@merks

merks commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Yes, the JustJ p2.manager is intended to be highly stable but I often add little convenient things and so don't really feel like maintaining a "stable" (milestone) stream because it's just as likely to be updated just as often. One important aspect here is that the promotion of the update site uses the p2.manager so it can't really be horribly broken. Only really Java release transitions are of some concern...

@laeubi
laeubi merged commit 44d576d into eclipse-tycho:main Jul 16, 2026
12 of 15 checks passed
@eclipse-tycho-bot

Copy link
Copy Markdown

💔 All backports failed

Status Branch Result
tycho-5.0.x Backport failed because of merge conflicts

You might need to backport the following PRs to tycho-5.0.x:
- Add tycho-p2-extras:p2-manager mojo for managing P2 update sites

Manual backport

To create the backport manually run:

backport --pr 6112

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@laeubi

laeubi commented Jul 16, 2026

Copy link
Copy Markdown
Member

@ptziegler it seems there are some conflicts, do you like to cherry pick the change and create a PR for Tycho 5?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

p2-manager Mojo fails due to missing JustJ repository

4 participants