tycho
tycho copied to clipboard
Make P2ArtifactRepositoryLayout actually lookup artifacts
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:
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.
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.
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...)
@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
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?
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.
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.
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.
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.
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...
BTW this will probably allow Tycho to consume e.g. P2 from I-Builds rather than waiting for the release/deployment to maven central.
This works now locally on my machine but is currently blocked by Bug 579072.
@merks this shows usage of P2 repositories without OSGi running.
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.
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.