tycho icon indicating copy to clipboard operation
tycho copied to clipboard

Make P2ArtifactRepositoryLayout actually lookup artifacts

Open laeubi opened this issue 2 years ago • 14 comments

Currently the P2ArtifactRepositoryLayout only provides a disabled repository. This implement it that way that it is possible to resolve p2. prefixed artifacts e.g in the form of:

p2.eclipse.plugin org.eclipse.osgi 3.17.0.v20210823-1805 eclipse-plugin

laeubi avatar Mar 03 '22 10:03 laeubi

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 17cffa08.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Mar 03 '22 10:03 github-actions[bot]

Please allow me some more time to think about it. As it can be the trigger of more important change, I'd rather take some time to feel comfortable with it than rushing it in as modifying is often harder.

mickaelistria avatar Mar 03 '22 10:03 mickaelistria

Sure i just wanted to share this early state so we can better discuss/decide here (I also have to find out why the component is sometimes not discovered here...)

laeubi avatar Mar 03 '22 10:03 laeubi

@mickaelistria @akurtakov It seems my plugin is missing the plexus/components.xml I assumed it will be created by the

<plugin>
	<groupId>org.codehaus.plexus</groupId>
	<artifactId>plexus-component-metadata</artifactId>
</plugin>

but it seems I'm missing something to trigger it...

Okay, it seems I should not put this into a <pluginMangement> section :-O

laeubi avatar Mar 03 '22 10:03 laeubi

Can you please include an itest to showcase how this can be used? Would one who use the tycho-maven-plugin extension also need to include this plugin as build extension or is the inclusion implicit?

mickaelistria avatar Mar 03 '22 12:03 mickaelistria

Can you please include an itest to showcase how this can be used?

For example it could be used like this (this does not currently works with this change):

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>org.eclipse.tycho-its</groupId>
	<artifactId>p2mavendependency</artifactId>
	<version>1.0.0</version>

	<packaging>jar</packaging>

	<properties>
		<tycho-version>3.0.0-SNAPSHOT</tycho-version>
		<p2-repo>https://download.eclipse.org/tools/orbit/downloads/2022-03/</p2-repo>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>p2-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
		</plugins>
	</build>

	<repositories>
		<repository>
			<id>p2-data-repo</id>
			<layout>p2</layout>
			<url>${p2-repo}</url>
		</repository>
	</repositories>

	<dependencies>
		<dependency>
			<groupId>p2.pluginx</groupId>
			<artifactId>org.slf4j.api</artifactId>
			<version>1.7.30</version>
			<type>eclipse-plugin</type>
		</dependency>
	</dependencies>

</project>

Would one who use the tycho-maven-plugin extension also need to include this plugin as build extension or is the inclusion implicit?

no for tycho users nothing would change.

laeubi avatar Mar 03 '22 15:03 laeubi

this does not currently works with this change

What is missing for such thing to work? Can making it work be in the scope of this change?

no for tycho users nothing would change.

Good.

mickaelistria avatar Mar 03 '22 16:03 mickaelistria

What is missing for such thing to work?

This is more in the scope of

  • #590

Can making it work be in the scope of this change?

Sure but this would make this change probably very big, and I wonder if it hurts to do the relocation independent from the implementation.

laeubi avatar Mar 03 '22 16:03 laeubi

My concerns is more that adding another plugin is there is currently no functional value isn't beneficial: more modules => more complexity. So I would rather wait for #590 to be working before we merge this refactoring. Those can be different commits on the same PRs.

mickaelistria avatar Mar 03 '22 16:03 mickaelistria

Sure, this might just take some time until fixes from P2 buble up the chain to tycho but we are probably not in a rush here...

laeubi avatar Mar 03 '22 16:03 laeubi

BTW this will probably allow Tycho to consume e.g. P2 from I-Builds rather than waiting for the release/deployment to maven central.

laeubi avatar Mar 03 '22 16:03 laeubi

This works now locally on my machine but is currently blocked by Bug 579072.

laeubi avatar Mar 04 '22 19:03 laeubi

@merks this shows usage of P2 repositories without OSGi running.

laeubi avatar Mar 04 '22 19:03 laeubi

Test Results

0 tests   0 :heavy_check_mark:  0s :stopwatch: 0 suites  0 :zzz: 0 files    0 :x:

Results for commit 9bb46398.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Jul 16 '22 06:07 github-actions[bot]

Closing this as the plan is to get rid of P2 as much as possible what will require to rework the concept of artifact downloads as well.

laeubi avatar May 18 '23 04:05 laeubi