Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maven-Runtime] convert projects into standard Maven-projects (#423) #466

Merged
merged 2 commits into from
Nov 20, 2022

Conversation

HannesWell
Copy link
Contributor

This PR has the goal to convert M2E's Maven runtime bundles (back) into full standard Maven projects that don't require special tooling/build as suggested in and to resolve #423.

To check for version regressions and to generate Eclipse-style build qualifiers the corresponding Tycho plug-ins are still used in the standard Maven build. This requires plug-in definitions like in the m2e-core/pom.xml, but those definitions should not be duplicated. At the same time m2e-maven-runtime/pom.xml cannot inherit from m2e's root pom.xml any more (because that one depends on the m2e-maven-runtime components) I introduced a m2e-parent Maven-project whose pom.xml contains the configuration shared by m2e-core/pom.xml and m2e-maven-runtime/pom.xml. Besides the build configuration also the legal elements. If you agree that this is a good idea, the m2e-parent could be introduced in a separate preceding PR?

As soon as #439 is merged the .settings/org.eclipse.pde.core.prefs and .project files can be completely removed.

With the current state of this PR the build is successful but in the IDE, the Maven-projects seem to not be considered by PDE as actually expected (and I already successfully tested with a small project). The m2e-maven-runtime bundles are always marked as missing in the Manifest's of other m2e plug-ins that require them.
@laeubi if you don't have an immediate idea why this is the case, I will investigate it in the next days.

@laeubi
Copy link
Member

laeubi commented Dec 26, 2021

@laeubi if you don't have an immediate idea why this is the case, I will investigate it in the next days.

no idea, are they listed in the target-platform state? Maybe there is another place in PDE where the BUNDLE_ROOT is not considered correctly? Have you tried this out with a current i-build?

@HannesWell
Copy link
Contributor Author

@laeubi if you don't have an immediate idea why this is the case, I will investigate it in the next days.

no idea, are they listed in the target-platform state? Maybe there is another place in PDE where the BUNDLE_ROOT is not considered correctly? Have you tried this out with a current i-build?

No they where not. But I have now tested it in the 'final form' with an Eclipse launched from my m2e workspace that contains PR #440 and a current I-Build target platform. And with my changes I just suggested in PR #440 it worked better. At least after a clean-full-build projects are listed in the Target Platform State view. It did not work out-of-the-box after the MavenProject import.
But the projects still have Error markers in the TP-State view (all but the slf4j-bundle) and Classes from the nested jars cannot be used in other plug-ins. For example if I want to use the org.apache.maven.Maven interface in another plug-in that class cannot be resolved and I get corresponding errors.
Therefore I think the problem is that the org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER does not work in conjunction with the RequiredPluginsClasspathContainer of PDE. This has to be investigated.
And yes this maybe is also caused by other code that does not consider BUNDLE_ROOT correctly.

@laeubi
Copy link
Member

laeubi commented Dec 29, 2021

Therefore I think the problem is that the org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER does not work in conjunction with the RequiredPluginsClasspathContainer of PDE. This has to be investigated.

I won't expect to have both for a pure maven bundle, is there a reason we need RequiredPluginsClasspathContainer here?

@HannesWell
Copy link
Contributor Author

Therefore I think the problem is that the org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER does not work in conjunction with the RequiredPluginsClasspathContainer of PDE. This has to be investigated.

I won't expect to have both for a pure maven bundle, is there a reason we need RequiredPluginsClasspathContainer here?

The containers are not mixed in one project. I meant that the RequiredPluginsClasspathContainer seems not to resolve the transitive dependencies contributed by the MAVEN2_CLASSPATH_CONTAINER of a required plug-in.
I.e. when I have another plug-in that requires bundle org.eclipse.m2e.maven.runtime (for example o.e.m2e.core), classes from transitive Maven dependencies of o.e.m2e.maven.runtime like org.apache.maven.Maven cannot be resolved in o.e.m2e.core.

I suspect that the ClassPath containers have to be adjusted for this case, but I have to investigate it.

@laeubi
Copy link
Member

laeubi commented Jan 1, 2022

I suspect that the ClassPath containers have to be adjusted for this case, but I have to investigate it.

Okay lets try to just do it step-by-step then :-)
Actually it should not matter where in the classpath something is pulled in, could we create a minimal-reporducer for that problem?

@laeubi
Copy link
Member

laeubi commented Jan 3, 2022

I suspect that the ClassPath containers have to be adjusted for this case, but I have to investigate it.

Okay lets try to just do it step-by-step then :-) Actually it should not matter where in the classpath something is pulled in, could we create a minimal-reporducer for that problem?

This seems to be fixed by apache/felix-dev#124 ?

@HannesWell
Copy link
Contributor Author

HannesWell commented Jan 3, 2022

Only from updating to Tycho 2.6.0-SNAPSHOT (commit ce46946) the build of this branch fails (Tycho 2.5.0 works on this branch, on the master Tycho 2.6.0-SNAPSHOT works as well):
https://ci.eclipse.org/m2e/job/m2e/job/PR-466/9/

[INFO] ----------------< org.eclipse.m2e:org.eclipse.m2e.site >----------------
[INFO] Building Maven Integration for Eclipse Update Site 1.16.0-SNAPSHOT [34/47]
[INFO] -------------------------[ eclipse-repository ]-------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ org.eclipse.m2e.site ---
[INFO] 
[INFO] --- tycho-packaging-plugin:2.6.0-SNAPSHOT:build-qualifier-aggregator (default-build-qualifier-aggregator) @ org.eclipse.m2e.site ---
[INFO] The project's OSGi version is 1.16.0.20220103-0829
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean-1) @ org.eclipse.m2e.site ---
[INFO] 
[INFO] --- target-platform-configuration:2.6.0-SNAPSHOT:target-platform (default-target-platform) @ org.eclipse.m2e.site ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default) @ org.eclipse.m2e.site ---
[INFO] argLine set to -javaagent:/home/jenkins/agent/workspace/m2e_PR-466/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/home/jenkins/agent/workspace/m2e_PR-466/target/jacoco.exec,append=true,includes=org.eclipse.m2e*:org.apache.maven*:org.eclipse.aether*
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ org.eclipse.m2e.site ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/jenkins/agent/workspace/m2e_PR-466/org.eclipse.m2e.site/src/main/resources
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:2.6.0-SNAPSHOT:publish-osgi-ee (default-publish-osgi-ee) @ org.eclipse.m2e.site ---
[INFO] Published profile IUs: [a.jre.javase 11.0.0]
[INFO] Published profile IUs: [a.jre.javase 17.0.0]
[WARNING] No system packages found in profile nor toolchain for JavaSE-18, using current JRE system packages.
This can cause faulty dependency resolution, consider adding a definition for a 'jdk' with id=JavaSE-18 in your toolchains.xml
[INFO] Published profile IUs: [a.jre.javase 18.0.0]
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:2.6.0-SNAPSHOT:publish-products (default-publish-products) @ org.eclipse.m2e.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:2.6.0-SNAPSHOT:publish-categories (default-publish-categories) @ org.eclipse.m2e.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:2.6.0-SNAPSHOT:attach-artifacts (default-attach-artifacts) @ org.eclipse.m2e.site ---
[INFO] 
[INFO] --- tycho-p2-repository-plugin:2.6.0-SNAPSHOT:assemble-repository (default-assemble-repository) @ org.eclipse.m2e.site ---
[INFO] {osgi.os=win32, osgi.ws=win32, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.eclipse.m2e.site raw:1.16.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):1.16.0-SNAPSHOT
[ERROR]   Missing requirement: org.eclipse.m2e.feature.feature.group 1.19.1.20220103-0829 requires 'org.eclipse.equinox.p2.iu; org.eclipse.m2e.maven.runtime.slf4j.simple [1.18.1.20211008-0657,1.18.1.20211008-0657]' but it could not be found
[ERROR]   Cannot satisfy dependency: org.eclipse.m2e.site raw:1.16.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):1.16.0-SNAPSHOT depends on: org.eclipse.equinox.p2.iu; org.eclipse.m2e.feature.feature.group 0.0.0
[ERROR] 
[ERROR] See https://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Maven Integration for Eclipse (root-parent) 1.16.0-SNAPSHOT SUCCESS [  4.565 s]
[INFO] [target] m2e-target-platform 1.16.0-SNAPSHOT ....... SUCCESS [  0.193 s]
[INFO] [bundle] M2E Maven Project Model Edit 1.18.2-SNAPSHOT SUCCESS [  8.686 s]
[INFO] Maven Integration for Eclipse Core Plug-in 1.18.4-SNAPSHOT SUCCESS [  5.801 s]
[INFO] [bundle] M2E Maven Integration for Eclipse UI 1.18.2-SNAPSHOT SUCCESS [  5.035 s]
[INFO] [bundle] M2E Launching 1.17.4-SNAPSHOT ............. SUCCESS [  2.612 s]
[INFO] [bundle] M2E JDT Integration 1.18.3-SNAPSHOT ....... SUCCESS [  1.959 s]
[INFO] [bundle] Maven Integration for Eclipse JDT UI 1.17.2-SNAPSHOT SUCCESS [  1.776 s]
[INFO] [bundle] M2E Refactoring 1.17.3-SNAPSHOT ........... SUCCESS [  2.907 s]
[INFO] [bundle] M2E Marketplace Discovery 1.18.1-SNAPSHOT . SUCCESS [  3.091 s]
[INFO] [bundle] M2E Maven POM File Editor 1.18.3-SNAPSHOT . SUCCESS [  3.881 s]
[INFO] [bundle] M2E Maven POM File XML Editor 1.18.2-SNAPSHOT SUCCESS [  3.331 s]
[INFO] [bundle] Default Build Lifecycle Mapping Metadata 1.17.1-SNAPSHOT SUCCESS [  1.340 s]
[INFO] [bundle] SCM Maven Integration for Eclipse 1.17.2-SNAPSHOT SUCCESS [  2.335 s]
[INFO] [bundle] M2E Maven Profiles Management 1.17.2-SNAPSHOT SUCCESS [  1.950 s]
[INFO] [bundle] M2E Maven Profiles Management UI 1.17.3-SNAPSHOT SUCCESS [  2.419 s]
[INFO] [bundle] M2E Import Framework 1.17.3-SNAPSHOT ...... SUCCESS [  2.241 s]
[INFO] [bundle] M2E Source Lookup Core 1.17.4-SNAPSHOT .... SUCCESS [  2.918 s]
[INFO] [bundle] M2E Binary Project Core 1.17.4-SNAPSHOT ... SUCCESS [  2.332 s]
[INFO] [bundle] Binary project UI 1.18.1-SNAPSHOT ......... SUCCESS [  2.045 s]
[INFO] [bundle] M2E Source Lookup UI 1.17.3-SNAPSHOT ...... SUCCESS [  3.029 s]
[INFO] org.eclipse.m2e.editor.lemminx 1.18.4-SNAPSHOT ..... SUCCESS [  3.754 s]
[INFO] [bundle] M2E PDE Integration 1.20.0-SNAPSHOT ....... SUCCESS [  3.085 s]
[INFO] [bundle] M2E PDE Integration UI 1.20.0-SNAPSHOT .... SUCCESS [  2.902 s]
[INFO] [bundle] M2E Testing Helpers 1.17.5-SNAPSHOT ....... SUCCESS [  2.443 s]
[INFO] [bundle] M2E Logback Appender 1.17.2-SNAPSHOT ...... SUCCESS [  2.143 s]
[INFO] [bundle] M2E Logback Configuration 1.16.3-SNAPSHOT . SUCCESS [  2.382 s]
[INFO] [feature] M2E - POM Editor using LemMinX language server (includes Incubating components) 1.18.4-SNAPSHOT SUCCESS [  1.552 s]
[INFO] [feature] M2E - Maven Integration for Eclipse (includes Incubating components) 1.19.1-SNAPSHOT SUCCESS [  1.578 s]
[INFO] [feature] M2E - POM Editor (Legacy) using WebTools SourceEditing UI 1.18.2-SNAPSHOT SUCCESS [  1.276 s]
[INFO] [feature] M2E - SLF4J over Logback Logging (optional) 1.17.2-SNAPSHOT SUCCESS [  1.218 s]
[INFO] [feature] M2E - PDE Integration 1.19.0-SNAPSHOT .... SUCCESS [  1.021 s]
[INFO] [feature] M2E - Complete Development Kit (optional) 1.19.1-SNAPSHOT SUCCESS [  1.277 s]
[INFO] Maven Integration for Eclipse Update Site 1.16.0-SNAPSHOT FAILURE [  0.525 s]
[INFO] org.eclipse.m2e.core.tests 1.16.1-SNAPSHOT ......... SKIPPED
[INFO] org.eclipse.m2e.core.ui.tests 1.18.1-SNAPSHOT ...... SKIPPED
[INFO] Tests for Maven Integration for Eclipse Importer framework 1.16.1-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E Binary Project Core Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] Tests for m2e multi-page editor 1.0.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E Maven POM File Editor using Wild Web Developer, Lemminx and Maven LS extension Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E JDT Integration Tests 1.16.2-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E WTP-based Maven POM File Editor Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] org.eclipse.m2e.profiles.core.tests 1.16.1-SNAPSHOT  SKIPPED
[INFO] m2e-core-tests 1.16.0-SNAPSHOT ..................... SKIPPED
[INFO] Maven Integration for Eclipse tests 1.17.2-SNAPSHOT  SKIPPED
[INFO] Maven Integration for Eclipse POM Editor tests 1.16.0-SNAPSHOT SKIPPED
[INFO] Maven POM XML Editor Tests 1.17.2-SNAPSHOT ......... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:42 min
[INFO] Finished at: 2022-01-03T09:14:45Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-repository-plugin:2.6.0-SNAPSHOT:assemble-repository (default-assemble-repository) on project org.eclipse.m2e.site: Execution default-assemble-repository of goal org.eclipse.tycho:tycho-p2-repository-plugin:2.6.0-SNAPSHOT:assemble-repository failed: Cannot resolve dependencies of MavenProject: org.eclipse.m2e:org.eclipse.m2e.site:1.16.0-SNAPSHOT @ /home/jenkins/agent/workspace/m2e_PR-466/org.eclipse.m2e.site/pom.xml: See log for details -> [Help 1]

@HannesWell
Copy link
Contributor Author

HannesWell commented Jan 3, 2022

Using the mixed Maven/Eclipse project reactor also failed:
https://ci.eclipse.org/m2e/job/m2e/job/PR-466/11/

[INFO] Resolving dependencies of MavenProject: org.eclipse.m2e:org.eclipse.m2e.core:1.18.4-SNAPSHOT @ /home/jenkins/agent/workspace/m2e_PR-466/org.eclipse.m2e.core/pom.xml
[INFO] {osgi.os=win32, osgi.ws=win32, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.eclipse.m2e.core 1.18.4.qualifier
[ERROR]   Missing requirement: org.eclipse.m2e.core 1.18.4.qualifier requires 'osgi.bundle; org.eclipse.m2e.maven.runtime [1.16.0,2.0.0)' but it could not be found
[ERROR] 
[ERROR] See https://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: org.eclipse.m2e:org.eclipse.m2e.core:1.18.4-SNAPSHOT @ /home/jenkins/agent/workspace/m2e_PR-466/org.eclipse.m2e.core/pom.xml: See log for details -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Or did I do something wrong?

@HannesWell
Copy link
Contributor Author

I suspect that the ClassPath containers have to be adjusted for this case, but I have to investigate it.

Okay lets try to just do it step-by-step then :-) Actually it should not matter where in the classpath something is pulled in, could we create a minimal-reporducer for that problem?

This seems to be fixed by apache/felix-dev#124 ?

I cannot confirm this. I my test setup I didn't make a difference. Have you checked if the .classpath file is a 'pure' Maven-project classpath and does not contain elements generated before? When switching branches it can happen that the .classpath file is not updated.

@laeubi
Copy link
Member

laeubi commented Jan 3, 2022

Or did I do something wrong?

The changes for this are currently not merged to master so only visible if you checkout the PR and build a custom version of tycho.

@HannesWell
Copy link
Contributor Author

Or did I do something wrong?

The changes for this are currently not merged to master so only visible if you checkout the PR and build a custom version of tycho.

🤦🏽‍♂️ Yes, I noticed that too just in this second. This cannot work here.
But when I tested it on my computer I installed PR eclipse-tycho/tycho#470 locally and it failed too.
I will just record the error message.

@HannesWell
Copy link
Contributor Author

When locally installing eclipse-tycho/tycho#470 and using Tycho 2.6.0-SNAPSHOT the build of commit ce46946) fails:

[INFO] --------------< org.eclipse.m2e:org.eclipse.m2e.feature >---------------
[INFO] Building [feature] M2E - Maven Integration for Eclipse (includes Incubating components) 1.19.1-SNAPSHOT [29/43]
[INFO] --------------------------[ eclipse-feature ]---------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ org.eclipse.m2e.feature ---
[INFO]
[INFO] --- tycho-packaging-plugin:2.6.0-SNAPSHOT:build-qualifier-aggregator (default-build-qualifier-aggregator) @ org.eclipse.m2e.feature ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Maven Integration for Eclipse (root-parent) 1.16.0-SNAPSHOT SUCCESS [  0.360 s]
[INFO] [target] m2e-target-platform 1.16.0-SNAPSHOT ....... SUCCESS [  0.150 s]
[INFO] [bundle] M2E Maven Project Model Edit 1.18.2-SNAPSHOT SUCCESS [ 14.597 s]
[INFO] Maven Integration for Eclipse Core Plug-in 1.18.4-SNAPSHOT SUCCESS [ 14.616 s]
[INFO] [bundle] M2E Maven Integration for Eclipse UI 1.18.2-SNAPSHOT SUCCESS [ 11.268 s]
[INFO] [bundle] M2E Launching 1.17.4-SNAPSHOT ............. SUCCESS [  3.982 s]
[INFO] [bundle] M2E JDT Integration 1.18.3-SNAPSHOT ....... SUCCESS [  4.594 s]
[INFO] [bundle] Maven Integration for Eclipse JDT UI 1.17.2-SNAPSHOT SUCCESS [  2.443 s]
[INFO] [bundle] M2E Refactoring 1.17.3-SNAPSHOT ........... SUCCESS [  2.938 s]
[INFO] [bundle] M2E Marketplace Discovery 1.18.1-SNAPSHOT . SUCCESS [  2.903 s]
[INFO] [bundle] M2E Maven POM File Editor 1.18.2-SNAPSHOT . SUCCESS [  6.592 s]
[INFO] [bundle] M2E Maven POM File XML Editor 1.18.2-SNAPSHOT SUCCESS [  4.024 s]
[INFO] [bundle] Default Build Lifecycle Mapping Metadata 1.17.1-SNAPSHOT SUCCESS [  1.249 s]
[INFO] [bundle] SCM Maven Integration for Eclipse 1.17.2-SNAPSHOT SUCCESS [  2.634 s]
[INFO] [bundle] M2E Maven Profiles Management 1.17.2-SNAPSHOT SUCCESS [  1.821 s]
[INFO] [bundle] M2E Maven Profiles Management UI 1.17.3-SNAPSHOT SUCCESS [  2.450 s]
[INFO] [bundle] M2E Import Framework 1.17.3-SNAPSHOT ...... SUCCESS [  1.989 s]
[INFO] [bundle] M2E Source Lookup Core 1.17.4-SNAPSHOT .... SUCCESS [  2.171 s]
[INFO] [bundle] M2E Binary Project Core 1.17.4-SNAPSHOT ... SUCCESS [  2.303 s]
[INFO] [bundle] Binary project UI 1.18.1-SNAPSHOT ......... SUCCESS [  2.212 s]
[INFO] [bundle] M2E Source Lookup UI 1.17.3-SNAPSHOT ...... SUCCESS [  2.325 s]
[INFO] org.eclipse.m2e.editor.lemminx 1.18.4-SNAPSHOT ..... SUCCESS [  3.869 s]
[INFO] [bundle] M2E PDE Integration 1.20.0-SNAPSHOT ....... SUCCESS [  3.099 s]
[INFO] [bundle] M2E PDE Integration UI 1.20.0-SNAPSHOT .... SUCCESS [  3.783 s]
[INFO] [bundle] M2E Testing Helpers 1.17.5-SNAPSHOT ....... SUCCESS [  2.377 s]
[INFO] [bundle] M2E Logback Appender 1.17.2-SNAPSHOT ...... SUCCESS [  1.879 s]
[INFO] [bundle] M2E Logback Configuration 1.16.3-SNAPSHOT . SUCCESS [  1.461 s]
[INFO] [feature] M2E - POM Editor using LemMinX language server (includes Incubating components) 1.18.4-SNAPSHOT SUCCESS [  1.432 s]
[INFO] [feature] M2E - Maven Integration for Eclipse (includes Incubating components) 1.19.1-SNAPSHOT FAILURE [  0.102 s]
[INFO] [feature] M2E - POM Editor (Legacy) using WebTools SourceEditing UI 1.18.2-SNAPSHOT SKIPPED
[INFO] [feature] M2E - SLF4J over Logback Logging (optional) 1.17.2-SNAPSHOT SKIPPED
[INFO] [feature] M2E - PDE Integration 1.19.0-SNAPSHOT .... SKIPPED
[INFO] [feature] M2E - Complete Development Kit (optional) 1.19.1-SNAPSHOT SKIPPED
[INFO] Maven Integration for Eclipse Update Site 1.16.0-SNAPSHOT SKIPPED
[INFO] org.eclipse.m2e.core.tests 1.16.1-SNAPSHOT ......... SKIPPED
[INFO] org.eclipse.m2e.core.ui.tests 1.18.1-SNAPSHOT ...... SKIPPED
[INFO] Tests for Maven Integration for Eclipse Importer framework 1.16.1-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E Binary Project Core Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] Tests for m2e multi-page editor 1.0.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E Maven POM File Editor using Wild Web Developer, Lemminx and Maven LS extension Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E JDT Integration Tests 1.16.2-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E WTP-based Maven POM File Editor Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] org.eclipse.m2e.profiles.core.tests 1.16.1-SNAPSHOT  SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:20 min
[INFO] Finished at: 2022-01-03T10:51:10+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:2.6.0-SNAPSHOT:build-qualifier-aggregator (default-build-qualifier-aggregator) on project org.eclipse.m2e.feature: Execution default-build-qualifier-aggregator of goal org.eclipse.tycho:tycho-packaging-plugin:2.6.0-SNAPSHOT:build-qualifier-aggregator failed: Could not resolve plugin org.eclipse.m2e.archetype.common_0.0.0; Path to dependency:
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

@laeubi
Copy link
Member

laeubi commented Jan 3, 2022

Just wondering is m2e still using a site.xml and update-site packaging?

@HannesWell
Copy link
Contributor Author

When locally installing eclipse-tycho/tycho#470 and using Tycho 2.6.0-SNAPSHOT the build of commit faab02c) fails:

Could it be a problem that the packaing of the maven-runtime-bundles is jar (this was necessary to workaround another issues in maven-bundle-plugin with absolute windows paths in the resource inclusion)?

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Maven Integration for Eclipse (parent)                             [pom]
[INFO] M2E - Maven runtime bundles                                        [pom]
[INFO] M2E Maven Archetype Common                                         [jar]
[INFO] M2E Embedded Maven Runtime (includes Incubating components)        [jar]
[INFO] M2E Maven/Nexus Indexer                                            [jar]
[INFO] M2E SLF4J-Simple Binding for Embedded Maven Runtime                [jar]
[INFO] Maven Integration for Eclipse (root-parent)                        [pom]
[INFO] [target] m2e-target-platform                 [eclipse-target-definition]
[INFO] [bundle] M2E Maven Project Model Edit                   [eclipse-plugin]
[INFO] Maven Integration for Eclipse Core Plug-in              [eclipse-plugin]
[INFO] [bundle] M2E Maven Integration for Eclipse UI           [eclipse-plugin]
[INFO] [bundle] M2E Launching                                  [eclipse-plugin]
[INFO] [bundle] M2E JDT Integration                            [eclipse-plugin]
[INFO] [bundle] Maven Integration for Eclipse JDT UI           [eclipse-plugin]
[INFO] [bundle] M2E Refactoring                                [eclipse-plugin]
[INFO] [bundle] M2E Marketplace Discovery                      [eclipse-plugin]
[INFO] [bundle] M2E Maven POM File Editor                      [eclipse-plugin]
[INFO] [bundle] M2E Maven POM File XML Editor                  [eclipse-plugin]
[INFO] [bundle] Default Build Lifecycle Mapping Metadata       [eclipse-plugin]
[INFO] [bundle] SCM Maven Integration for Eclipse              [eclipse-plugin]
[INFO] [bundle] M2E Maven Profiles Management                  [eclipse-plugin]
[INFO] [bundle] M2E Maven Profiles Management UI               [eclipse-plugin]
[INFO] [bundle] M2E Import Framework                           [eclipse-plugin]
[INFO] [bundle] M2E Source Lookup Core                         [eclipse-plugin]
[INFO] [bundle] M2E Binary Project Core                        [eclipse-plugin]
[INFO] [bundle] Binary project UI                              [eclipse-plugin]
[INFO] [bundle] M2E Source Lookup UI                           [eclipse-plugin]
[INFO] org.eclipse.m2e.editor.lemminx                          [eclipse-plugin]
[INFO] [bundle] M2E PDE Integration                            [eclipse-plugin]
[INFO] [bundle] M2E PDE Integration UI                         [eclipse-plugin]
[INFO] [bundle] M2E Testing Helpers                            [eclipse-plugin]
[INFO] [bundle] M2E Logback Appender                           [eclipse-plugin]
[INFO] [bundle] M2E Logback Configuration                      [eclipse-plugin]
[INFO] [feature] M2E - POM Editor using LemMinX language server (includes Incubating components) [eclipse-feature]
[INFO] [feature] M2E - Maven Integration for Eclipse (includes Incubating components) [eclipse-feature]
[INFO] [feature] M2E - POM Editor (Legacy) using WebTools SourceEditing UI [eclipse-feature]
[INFO] [feature] M2E - SLF4J over Logback Logging (optional)  [eclipse-feature]
[INFO] [feature] M2E - PDE Integration                        [eclipse-feature]
[INFO] [feature] M2E - Complete Development Kit (optional)    [eclipse-feature]
[INFO] Maven Integration for Eclipse Update Site           [eclipse-repository]
[INFO] org.eclipse.m2e.core.tests                         [eclipse-test-plugin]
[INFO] org.eclipse.m2e.core.ui.tests                      [eclipse-test-plugin]
[INFO] Tests for Maven Integration for Eclipse Importer framework [eclipse-test-plugin]
[INFO] [test-bundle] M2E Binary Project Core Tests        [eclipse-test-plugin]
[INFO] [test-bundle] Tests for m2e multi-page editor      [eclipse-test-plugin]
[INFO] [test-bundle] M2E Maven POM File Editor using Wild Web Developer, Lemminx and Maven LS extension Tests [eclipse-test-plugin]
[INFO] [test-bundle] M2E JDT Integration Tests            [eclipse-test-plugin]
[INFO] [test-bundle] M2E WTP-based Maven POM File Editor Tests [eclipse-test-plugin]
[INFO] org.eclipse.m2e.profiles.core.tests                [eclipse-test-plugin]
[INFO]
[INFO] ---------------------< org.eclipse.m2e:m2e-parent >---------------------
[INFO] Building Maven Integration for Eclipse (parent) 1.16.0-SNAPSHOT   [1/49]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ m2e-parent ---
[INFO]
[INFO] --- tycho-p2-extras-plugin:2.6.0-SNAPSHOT:compare-version-with-baselines (check-no-version-regression) @ m2e-parent ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Maven Integration for Eclipse (parent) 1.16.0-SNAPSHOT FAILURE [  0.328 s]
[INFO] M2E - Maven runtime bundles 1.16.0-SNAPSHOT ........ SKIPPED
[INFO] M2E Maven Archetype Common 1.18.1-SNAPSHOT ......... SKIPPED
[INFO] M2E Embedded Maven Runtime (includes Incubating components) 1.18.2-SNAPSHOT SKIPPED
[INFO] M2E Maven/Nexus Indexer 1.18.1-SNAPSHOT ............ SKIPPED
[INFO] M2E SLF4J-Simple Binding for Embedded Maven Runtime 1.18.1-SNAPSHOT SKIPPED
[INFO] Maven Integration for Eclipse (root-parent) 1.16.0-SNAPSHOT SKIPPED
[INFO] [target] m2e-target-platform 1.16.0-SNAPSHOT ....... SKIPPED
[INFO] [bundle] M2E Maven Project Model Edit 1.18.2-SNAPSHOT SKIPPED
[INFO] Maven Integration for Eclipse Core Plug-in 1.18.4-SNAPSHOT SKIPPED
[INFO] [bundle] M2E Maven Integration for Eclipse UI 1.18.2-SNAPSHOT SKIPPED
[INFO] [bundle] M2E Launching 1.17.4-SNAPSHOT ............. SKIPPED
[INFO] [bundle] M2E JDT Integration 1.18.3-SNAPSHOT ....... SKIPPED
[INFO] [bundle] Maven Integration for Eclipse JDT UI 1.17.2-SNAPSHOT SKIPPED
[INFO] [bundle] M2E Refactoring 1.17.3-SNAPSHOT ........... SKIPPED
[INFO] [bundle] M2E Marketplace Discovery 1.18.1-SNAPSHOT . SKIPPED
[INFO] [bundle] M2E Maven POM File Editor 1.18.2-SNAPSHOT . SKIPPED
[INFO] [bundle] M2E Maven POM File XML Editor 1.18.2-SNAPSHOT SKIPPED
[INFO] [bundle] Default Build Lifecycle Mapping Metadata 1.17.1-SNAPSHOT SKIPPED
[INFO] [bundle] SCM Maven Integration for Eclipse 1.17.2-SNAPSHOT SKIPPED
[INFO] [bundle] M2E Maven Profiles Management 1.17.2-SNAPSHOT SKIPPED
[INFO] [bundle] M2E Maven Profiles Management UI 1.17.3-SNAPSHOT SKIPPED
[INFO] [bundle] M2E Import Framework 1.17.3-SNAPSHOT ...... SKIPPED
[INFO] [bundle] M2E Source Lookup Core 1.17.4-SNAPSHOT .... SKIPPED
[INFO] [bundle] M2E Binary Project Core 1.17.4-SNAPSHOT ... SKIPPED
[INFO] [bundle] Binary project UI 1.18.1-SNAPSHOT ......... SKIPPED
[INFO] [bundle] M2E Source Lookup UI 1.17.3-SNAPSHOT ...... SKIPPED
[INFO] org.eclipse.m2e.editor.lemminx 1.18.4-SNAPSHOT ..... SKIPPED
[INFO] [bundle] M2E PDE Integration 1.20.0-SNAPSHOT ....... SKIPPED
[INFO] [bundle] M2E PDE Integration UI 1.20.0-SNAPSHOT .... SKIPPED
[INFO] [bundle] M2E Testing Helpers 1.17.5-SNAPSHOT ....... SKIPPED
[INFO] [bundle] M2E Logback Appender 1.17.2-SNAPSHOT ...... SKIPPED
[INFO] [bundle] M2E Logback Configuration 1.16.3-SNAPSHOT . SKIPPED
[INFO] [feature] M2E - POM Editor using LemMinX language server (includes Incubating components) 1.18.4-SNAPSHOT SKIPPED
[INFO] [feature] M2E - Maven Integration for Eclipse (includes Incubating components) 1.19.1-SNAPSHOT SKIPPED
[INFO] [feature] M2E - POM Editor (Legacy) using WebTools SourceEditing UI 1.18.2-SNAPSHOT SKIPPED
[INFO] [feature] M2E - SLF4J over Logback Logging (optional) 1.17.2-SNAPSHOT SKIPPED
[INFO] [feature] M2E - PDE Integration 1.19.0-SNAPSHOT .... SKIPPED
[INFO] [feature] M2E - Complete Development Kit (optional) 1.19.1-SNAPSHOT SKIPPED
[INFO] Maven Integration for Eclipse Update Site 1.16.0-SNAPSHOT SKIPPED
[INFO] org.eclipse.m2e.core.tests 1.16.1-SNAPSHOT ......... SKIPPED
[INFO] org.eclipse.m2e.core.ui.tests 1.18.1-SNAPSHOT ...... SKIPPED
[INFO] Tests for Maven Integration for Eclipse Importer framework 1.16.1-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E Binary Project Core Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] Tests for m2e multi-page editor 1.0.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E Maven POM File Editor using Wild Web Developer, Lemminx and Maven LS extension Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E JDT Integration Tests 1.16.2-SNAPSHOT SKIPPED
[INFO] [test-bundle] M2E WTP-based Maven POM File Editor Tests 1.16.0-SNAPSHOT SKIPPED
[INFO] org.eclipse.m2e.profiles.core.tests 1.16.1-SNAPSHOT  SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  34.840 s
[INFO] Finished at: 2022-01-03T10:53:57+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:2.6.0-SNAPSHOT:compare-version-with-baselines (check-no-version-regression) on project m2e-parent: A type incompatibility occurred while executing org.eclipse.tycho.extras:tycho-p2-extras-plugin:2.6.0-SNAPSHOT:compare-version-with-baselines: class org.eclipse.tycho.core.osgitools.DefaultReactorProject cannot be cast to class org.eclipse.tycho.ReactorProject (org.eclipse.tycho.core.osgitools.DefaultReactorProject is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @108d55c4; org.eclipse.tycho.ReactorProject is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @5f419bba)
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.eclipse.tycho.extras:tycho-p2-extras-plugin:2.6.0-SNAPSHOT-439838402
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/extras/tycho-p2-extras-plugin/2.6.0-SNAPSHOT/tycho-p2-extras-plugin-2.6.0-SNAPSHOT.jar
[ERROR] urls[1] = file:/C:/Users/Hannes/.m2/repository/org/codehaus/plexus/plexus-utils/3.4.1/plexus-utils-3.4.1.jar
[ERROR] urls[2] = file:/C:/Users/Hannes/.m2/repository/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar
[ERROR] urls[3] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/tycho-p2-facade/2.6.0-SNAPSHOT/tycho-p2-facade-2.6.0-SNAPSHOT.jar
[ERROR] urls[4] = file:/C:/Users/Hannes/.m2/repository/org/codehaus/plexus/plexus-component-annotations/2.1.1/plexus-component-annotations-2.1.1.jar
[ERROR] urls[5] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/tycho-core/2.6.0-SNAPSHOT/tycho-core-2.6.0-SNAPSHOT.jar
[ERROR] urls[6] = file:/C:/Users/Hannes/.m2/repository/org/codehaus/plexus/plexus-archiver/4.2.2/plexus-archiver-4.2.2.jar
[ERROR] urls[7] = file:/C:/Users/Hannes/.m2/repository/org/codehaus/plexus/plexus-io/3.2.0/plexus-io-3.2.0.jar
[ERROR] urls[8] = file:/C:/Users/Hannes/.m2/repository/org/apache/commons/commons-compress/1.21/commons-compress-1.21.jar
[ERROR] urls[9] = file:/C:/Users/Hannes/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[10] = file:/C:/Users/Hannes/.m2/repository/org/tukaani/xz/1.8/xz-1.8.jar
[ERROR] urls[11] = file:/C:/Users/Hannes/.m2/repository/org/codehaus/plexus/plexus-cipher/2.0/plexus-cipher-2.0.jar
[ERROR] urls[12] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/tycho-metadata-model/2.6.0-SNAPSHOT/tycho-metadata-model-2.6.0-SNAPSHOT.jar
[ERROR] urls[13] = file:/C:/Users/Hannes/.m2/repository/de/pdark/decentxml/1.4/decentxml-1.4.jar
[ERROR] urls[14] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/tycho-embedder-api/2.6.0-SNAPSHOT/tycho-embedder-api-2.6.0-SNAPSHOT.jar
[ERROR] urls[15] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.embedder.shared/2.6.0-SNAPSHOT/org.eclipse.tycho.embedder.shared-2.6.0-SNAPSHOT.jar
[ERROR] urls[16] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.core.shared/2.6.0-SNAPSHOT/org.eclipse.tycho.core.shared-2.6.0-SNAPSHOT.jar
[ERROR] urls[17] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/sisu-equinox-embedder/2.6.0-SNAPSHOT/sisu-equinox-embedder-2.6.0-SNAPSHOT.jar
[ERROR] urls[18] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/platform/org.eclipse.osgi/3.17.100/org.eclipse.osgi-3.17.100.jar
[ERROR] urls[19] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.p2.resolver.shared/2.6.0-SNAPSHOT/org.eclipse.tycho.p2.resolver.shared-2.6.0-SNAPSHOT.jar
[ERROR] urls[20] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/org.eclipse.tycho.p2.tools.shared/2.6.0-SNAPSHOT/org.eclipse.tycho.p2.tools.shared-2.6.0-SNAPSHOT.jar
[ERROR] urls[21] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/tycho-artifactcomparator/2.6.0-SNAPSHOT/tycho-artifactcomparator-2.6.0-SNAPSHOT.jar
[ERROR] urls[22] = file:/C:/Users/Hannes/.m2/repository/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar
[ERROR] urls[23] = file:/C:/Users/Hannes/.m2/repository/org/ow2/asm/asm/9.2/asm-9.2.jar
[ERROR] urls[24] = file:/C:/Users/Hannes/.m2/repository/org/ow2/asm/asm-util/9.2/asm-util-9.2.jar
[ERROR] urls[25] = file:/C:/Users/Hannes/.m2/repository/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar
[ERROR] urls[26] = file:/C:/Users/Hannes/.m2/repository/org/codehaus/plexus/plexus-sec-dispatcher/2.0/plexus-sec-dispatcher-2.0.jar
[ERROR] urls[27] = file:/C:/Users/Hannes/.m2/repository/org/apache/maven/maven-builder-support/3.8.4/maven-builder-support-3.8.4.jar
[ERROR] urls[28] = file:/C:/Users/Hannes/.m2/repository/org/apache/maven/resolver/maven-resolver-util/1.6.3/maven-resolver-util-1.6.3.jar
[ERROR] urls[29] = file:/C:/Users/Hannes/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.3.4/maven-shared-utils-3.3.4.jar
[ERROR] urls[30] = file:/C:/Users/Hannes/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar
[ERROR] urls[31] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.5/org.eclipse.sisu.inject-0.3.5.jar
[ERROR] urls[32] = file:/C:/Users/Hannes/.m2/repository/com/google/inject/guice/4.2.2/guice-4.2.2-no_aop.jar
[ERROR] urls[33] = file:/C:/Users/Hannes/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[34] = file:/C:/Users/Hannes/.m2/repository/com/google/guava/guava/25.1-android/guava-25.1-android.jar
[ERROR] urls[35] = file:/C:/Users/Hannes/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
[ERROR] urls[36] = file:/C:/Users/Hannes/.m2/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar
[ERROR] urls[37] = file:/C:/Users/Hannes/.m2/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar
[ERROR] urls[38] = file:/C:/Users/Hannes/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
[ERROR] urls[39] = file:/C:/Users/Hannes/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
[ERROR] urls[40] = file:/C:/Users/Hannes/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.jar
[ERROR] urls[41] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/sisu-equinox-launching/2.6.0-SNAPSHOT/sisu-equinox-launching-2.6.0-SNAPSHOT.jar
[ERROR] urls[42] = file:/C:/Users/Hannes/.m2/repository/org/eclipse/tycho/sisu-equinox-api/2.6.0-SNAPSHOT/sisu-equinox-api-2.6.0-SNAPSHOT.jar
[ERROR] urls[43] = file:/C:/Users/Hannes/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

@HannesWell
Copy link
Contributor Author

Just wondering is m2e still using a site.xml and update-site packaging?

No it is just the (legacy) name.
A category.xml is used and the packaging type is eclipse-repository.

But it shouldn't be a problem to rename it.

@laeubi
Copy link
Member

laeubi commented Jan 3, 2022

Well at least the build starts ;-)
It seems there are some classpath problems with the compare-version-with-baselines but I don'T see how this could be related to this change...

Strange enough the tychobuild on the CI fails for some reason it seems my local state is slightly different but I don't see how... can you try to execute the test project in tycho/tycho-its/projects/mixed.reactor with your local build? that should work as a first step.

@HannesWell
Copy link
Contributor Author

Well at least the build starts ;-) It seems there are some classpath problems with the compare-version-with-baselines but I don'T see how this could be related to this change...

I have no clue either. But there is likely some other (unlreated) problem because only switching from Tycho 2.5.0 to 2.6.0-SNAPSHOT fails the build, with but also without tycho PR 470!

Strange enough the tychobuild on the CI fails for some reason it seems my local state is slightly different but I don't see how... can you try to execute the test project in tycho/tycho-its/projects/mixed.reactor with your local build? that should work as a first step.

That test setup builds successfully on my computer.

@laeubi
Copy link
Member

laeubi commented Jan 3, 2022

only switching from Tycho 2.5.0 to 2.6.0-SNAPSHOT fails the build, with but also without tycho PR 470!

can you try eclipse-tycho/tycho@1fe29d7 if that works?

@HannesWell
Copy link
Contributor Author

only switching from Tycho 2.5.0 to 2.6.0-SNAPSHOT fails the build, with but also without tycho PR 470!

can you try eclipse/tycho@1fe29d7 if that works?

With Tycho at that state the m2e build works. It also works with eclipse-tycho/tycho@4980ba6.

I can go the history further up to identify the commit that broke the build.

@laeubi
Copy link
Member

laeubi commented Jan 3, 2022

With Tycho at that state the m2e build works.

Thats good, as this most probably is the next candidate for the release...

@laeubi
Copy link
Member

laeubi commented Jan 3, 2022

By the way if you could derive a small reproducer of the problem that would be great otherwise I'll try to test with the m2e build...

@HannesWell
Copy link
Contributor Author

With Tycho at that state the m2e build works.

Thats good, as this most probably is the next candidate for the release...

I have to correct my statement, because when I build locally even the current tycho-master is working for this branchs commit ce46946 (switch to new Tycho version). But it failed on Jenkins.

The only difference between my local build and M2E-Jenkins is that on Jenkins the eclipse-sign profile is active and with it the tycho-p2-plugin:p2-metadata goal. At the moment I suspect this to be the difference.
Maybe the problem is not in Tycho at all, but I will investigate it.

@HannesWell
Copy link
Contributor Author

Even when running the p2-meta goal in my local build it passes with Tycho 2.6.0-SNAPSHOT. On Jenkins it still fails even when the eclipse-sign profile is deactivated:
https://ci.eclipse.org/m2e/job/m2e/job/PR-466/13/

From inspecting the console-log I assume the problem is that the tycho-p2-repository-plugin:assemble-repository goal somehow gets the wrong qualifier for org.eclipse.m2e.maven.runtime.slf4j.simple. The slf4j.simple is build with version 1.18.1.20211229-1027 but the repo is assembled with 1.18.1.20211008-0657, which is the current version in the m2e/snapshots/latest repo.

The question is, what is the root of this problem. IIRC the artifact replacement can be tricky for long standing PRs because the snapshots then contain more recent versions than the PR produces. But there have not been such change in the meantime.

I will try if a version update fixes the problem.

@HannesWell
Copy link
Contributor Author

OK, it looks like the problem is not in the current Tycho snapshot rather than in my change.
Sorry for the disturbance and I will investigate it.

@laeubi
Copy link
Member

laeubi commented Jan 3, 2022

Never mind, the more testing the better.

@laeubi
Copy link
Member

laeubi commented Jan 7, 2022

@HannesWell the 2.7.0-SNAPSHOT should now contain this feature soon.

@laeubi
Copy link
Member

laeubi commented Nov 13, 2022

I have the impression that it is problematic that the m2e.maven.runtime depends on a bundle from the TP.

At least it is something strange, but as we do not build the code one wont notice it, in general I think Tycho do not care much about the source, but the new resolver with Tycho 4.0 will do and hopefully better address such missconfigurations.

For this specific error I think it is more the org.slf4j.impl that seems unresolvable, are we sure we have an SLF4 impl there?

@HannesWell
Copy link
Contributor Author

For this specific error I think it is more the org.slf4j.impl that seems unresolvable, are we sure we have an SLF4 impl there?

Yes we do. It is provided by ch.qos.logback.classic:

grafik

And this PR only changes the way the 'maven-runtime' bundles are build. The generated Manifest will remain unchanged (at least the relevant entries).
Maybe one problem is, that slf4j.api, ch.qos.logback.core and ch.qos.logback.classic form a circle. But that isn't a problem at the moment.

@laeubi
Copy link
Member

laeubi commented Nov 13, 2022

I still think it might be good to not embeds the jars but having them as maven-target components that are fragments to the runtime bundle and export their additional packages using a customization in the target. But I have not tried if this works any better... (most probably we would need some hacks like extensible api header for PDE then).... but <pomDependencies>consider</pomDependencies> is also really upgly because it just pulls in to much unneeded stuff that can cause issues... but I'm working on something more nice in Tycho 4.0 already that hopefully would improve such situations.

@HannesWell
Copy link
Contributor Author

I still think it might be good to not embeds the jars but having them as maven-target components that are fragments to the runtime bundle and export their additional packages using a customization in the target.

One big problem that I see is that, since OSGi is a dynamic environment and we cannot completely control which bundle is wired to which other bundle. Therefore it could happen that one component from the maven-runtime is actually wired to another jar than the original maven installation, which could lead to subtle differences to the original Maven installation and therefore hard to find errors.

Another problem could be if a Service-Loader is used in one of the embedded component. Then we would have to configure the Service-Loader Mediator to make it work.

Furthermore I think it would be good to have at lest a few Maven projects so that we have to eat our own dog-food. :)
And short before a release we should not make such fundamental change, where probably other things have to be fixed too.
But for the archetype.commons I would be open to try if that is a feasible solution. When using a generated feature we could at least ensure that all bundles are installed together.

But I have not tried if this works any better... (most probably we would need some hacks like extensible api header for PDE then).... but <pomDependencies>consider</pomDependencies> is also really upgly because it just pulls in to much unneeded stuff that can cause issues... but I'm working on something more nice in Tycho 4.0 already that hopefully would improve such situations.

Is that already available as snapshot? I wouldn't mind to use Tycho 4.0-SNAPSHOT if that helps.

@laeubi
Copy link
Member

laeubi commented Nov 13, 2022

One big problem that I see is that, since OSGi is a dynamic environment and we cannot completely control which bundle is wired to which other bundle

Fragments can only be attached to their declared hosts. There is no wiring involved.

Another problem could be if a Service-Loader is used in one of the embedded component.

Fragments are not "components" in that sense and you cannot act uppon them as they have no BundleContext/ClassLoader at all but just extend their host.

hen using a generated feature we could at least ensure that all bundles are installed together.

For the installation I would just use a p2.inf as swt does:
https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/META-INF/p2.inf

this force p2 to always install all fragments.

@HannesWell HannesWell force-pushed the mavenRuntime branch 3 times, most recently from 0e769b0 to 48f0e95 Compare November 13, 2022 21:16
@HannesWell
Copy link
Contributor Author

One big problem that I see is that, since OSGi is a dynamic environment and we cannot completely control which bundle is wired to which other bundle

Fragments can only be attached to their declared hosts. There is no wiring involved.

Another problem could be if a Service-Loader is used in one of the embedded component.

Fragments are not "components" in that sense and you cannot act uppon them as they have no BundleContext/ClassLoader at all but just extend their host.

Indeed, I didn't consider that bundles and their fragments share the same class-loader and effectively have a flat shared classpath. And yes the fragment-host's version-range should be made so tight that it only allows exactly one version.
Then there should only one fixed set of fragments for each m2e.maven.runtime version.
But if we do that and then update the maven version and a contained bundles stays at the same version we cannot adjust the host version-range. So that will not work well.
However the question is if that is actually necessary. Maybe making those fragments singletons would be a better way to ensure version consistency.

Another difficulty is in the test execution during the build because tycho-surefire does not add fragments to the runtime.
But this could be worked around by providing a separate m2e-test-parent/pom.xml that adds the fragments to test TP. with corresponding pom.model.parent entries in the build.properties all test projects could reference that then.

hen using a generated feature we could at least ensure that all bundles are installed together.

For the installation I would just use a p2.inf as swt does: https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/META-INF/p2.inf

this force p2 to always install all fragments.

What would be the advantage compared to a generated feature? We could then include that feature into the m2e feature, which would also force p2 to install a Plug-in? And I have the impression that such p2.inf has to be maintained manually or at least generated in a script.

Anyway, I think I managed to work-around the classpath-validation error by just adding an additional Import-Package org.slf4j.spi;version="[1.7.31,3.0.0)" to o.e.m2e.core. Since the slf4j.api bundle exports that package too, I think this is not a big drawback for now and as soon as Tycho succeeds without it can be removed again.
Therefore I suggest to go with this approach for now and then try to implement your suggestion for the next release.

The build now succeeds and main and source artefacts are build (I have to check again if their content did not change in a relevant way). In the IDE also the .classpath file is generated properly (on full build) and M2E even managed to find the sources for the embedded jars (but I don't know how^^).
So in general I think this is ready and there are no more blockers.

@HannesWell
Copy link
Contributor Author

HannesWell commented Nov 18, 2022

As soon as #1068 is available in the snapshots (I think that is OK, since M2E devs should always use the latest snapshots and we are close to the next release), this can be considered for merging.
That change make the profile only activated in the IDE (by the presence of the m2e.version property) obsolete.

The main missing part is to double check that the jars build eventually did not change in a significant way.

@HannesWell HannesWell force-pushed the mavenRuntime branch 3 times, most recently from 057ebb6 to aa66a88 Compare November 19, 2022 21:13
This Maven-project contains elements common to all M2E modules
regardless of their packaging-type and serves as their parent.
@HannesWell
Copy link
Contributor Author

HannesWell commented Nov 20, 2022

Almost everything looks good now. Only two things are currently not working:
The source-bundles for o.e.m2e.maven.runtime and o.e.m2e.archetype.common are not included into the source feature of the o.e.m2e feature although the source artifact/jar name schema is the same like for those generated by Tycho for Eclipse Plugins and although the source jar is attached to the project with type jar and classifier sources.

@laeubi do you have an idea why this is the case?

Do you think https://tycho.eclipseprojects.io/doc/3.0.0/tycho-source-plugin/feature-source-mojo.html#plugins could help?
Or do I have to do some magic with the tycho-p2-publisher-plugin? Would that even be possible.

And the other thing is that, sometimes in the IDE the maven-resources-plugin is not executed because the mojo configuration failed and therefore the content of src/main/resources is not copied to target/classes. This is problematic for m2e.maven.runtime because then the logger config is missing.

@HannesWell HannesWell force-pushed the mavenRuntime branch 2 times, most recently from 113b0ec to 6603f87 Compare November 20, 2022 15:43
@HannesWell
Copy link
Contributor Author

HannesWell commented Nov 20, 2022

Thank you @laeubi for the hint (via private-chat) about the tycho-p2-plugin:p2-metadata goal. If somebody is interested, it is described here:
https://github.com/eclipse-tycho/tycho/blob/master/RELEASE_NOTES.md#automatic-generation-of-pde-source-bundles-for-pom-first-bundles
But I used it a bit different.

The second point I mentioned, the resolution failure of the resources-plugin didn't happen again, so maybe it was a local problem on my computer.

When the current build has succeeded I will make some final check of the generated artifacts and then I think this is finally ready for submission.

@HannesWell HannesWell marked this pull request as ready for review November 20, 2022 15:49
@HannesWell
Copy link
Contributor Author

I just did the final check of the result jars and the resulting content is equal (in all relevant aspects).

So this is finally ready for submission. 🎉

@HannesWell HannesWell merged commit e9e9b0c into eclipse-m2e:master Nov 20, 2022
@HannesWell HannesWell deleted the mavenRuntime branch November 20, 2022 17:23
@HannesWell HannesWell added this to the 2.1.0 milestone Nov 24, 2022
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.

Let m2e-maven-runtime use standard maven tooling / build
3 participants