eclipse-equinox/p2

Broken Java 11 Tycho Build due to new org.eclipse.equinox.common 3.19 getting picked up

Closed this issue · 2 comments

rgra commented

On March 12th we started getting build failures for our Java 11 Tycho 2.7 based builds.

Downloaded from nexus: http://nexus:8091/repository/maven-public/org/eclipse/platform/org.eclipse.core.runtime/3.31.0/org.eclipse.core.runtime-3.31.0.pom (2.8 kB at 7.4 kB/s)
[WARNING] Error injecting: org.eclipse.tycho.build.TychoGraphBuilder
java.lang.UnsupportedClassVersionError: org/eclipse/core/runtime/IProgressMonitor has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

I found out that tycho-build:jar:2.7.0 is using a fixed org.eclipse.equinox.p2.core version.
But this in turn is using a broader version constraint for org.eclipse.platform:org.eclipse.equinox.common and thus now picks up the newly deploy 3.19 version which needs Java 17.

The dependency tree shows, there are even more new versions used: org.eclipse.core.jobs:jar:3.15.200, org.eclipse.equinox.registry:jar:3.12.0

[INFO] --- dependency:3.2.0:tree (default-cli) @ tycho-build ---
[INFO] org.eclipse.tycho:tycho-build:jar:2.7.0
[INFO] +- org.codehaus.plexus:plexus-utils:jar:3.4.1:provided
[INFO] +- org.eclipse.tycho.extras:tycho-pomless:jar:2.7.0:compile
[INFO] | - io.takari.polyglot:polyglot-common:jar:0.4.8:compile
[INFO] +- org.eclipse.tycho:org.eclipse.tycho.core.shared:jar:2.7.0:compile
[INFO] +- org.eclipse.tycho:org.eclipse.tycho.p2.maven.repository:jar:2.7.0:compile
[INFO] +- org.eclipse.platform:org.eclipse.equinox.p2.core:jar:2.8.100:compile
[INFO] | - org.eclipse.platform:org.eclipse.equinox.common:jar:3.19.0:compile (version selected from constraint [3.5.0,4.0.0))
[INFO] +- org.eclipse.platform:org.eclipse.osgi:jar:3.17.100:compile
[INFO] +- org.eclipse.platform:org.eclipse.equinox.p2.publisher:jar:1.6.200:compile
[INFO] +- org.eclipse.platform:org.eclipse.equinox.p2.director:jar:2.5.100:compile
[INFO] | +- org.eclipse.platform:org.eclipse.core.jobs:jar:3.15.200:compile (version selected from constraint [3.3.0,4.0.0))
[INFO] | +- org.ow2.sat4j:org.ow2.sat4j.core:jar:2.3.6:compile (version selected from constraint [2.3.5,3.0.0))
[INFO] | - org.ow2.sat4j:org.ow2.sat4j.pb:jar:2.3.6:compile (version selected from constraint [2.3.5,3.0.0))
[INFO] +- org.eclipse.platform:org.eclipse.equinox.p2.engine:jar:2.7.200:compile
[INFO] | - org.eclipse.platform:org.eclipse.equinox.registry:jar:3.12.0:compile (version selected from constraint [0.0,))
[INFO] +- org.eclipse.platform:org.eclipse.equinox.p2.metadata:jar:2.6.100:compile
[INFO] +- org.eclipse.platform:org.eclipse.equinox.p2.repository:jar:2.5.300:compile
[INFO] +- org.eclipse.platform:org.eclipse.osgi.compatibility.state:jar:1.2.500:compile
[INFO] +- org.eclipse.platform:org.eclipse.equinox.p2.publisher.eclipse:jar:1.4.1:compile
[INFO] +- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.5:provided
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.2:provided
[INFO] | +- javax.enterprise:cdi-api:jar:1.2:provided
[INFO] | +- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.5:provided
[INFO] | +- org.codehaus.plexus:plexus-component-annotations:jar:2.1.1:provided
[INFO] | - org.codehaus.plexus:plexus-classworlds:jar:2.5.2:provided
[INFO] +- org.apache.maven:maven-model:jar:3.8.4:provided
[INFO] +- org.apache.maven:maven-model-builder:jar:3.8.4:provided
[INFO] | +- org.codehaus.plexus:plexus-interpolation:jar:1.26:provided
[INFO] | +- javax.inject:javax.inject:jar:1:provided
[INFO] | +- org.apache.maven:maven-artifact:jar:3.8.4:provided
[INFO] | - org.apache.maven:maven-builder-support:jar:3.8.4:provided
[INFO] +- org.apache.maven:maven-core:jar:3.8.4:provided
[INFO] | +- org.apache.maven:maven-settings:jar:3.8.4:provided
[INFO] | +- org.apache.maven:maven-settings-builder:jar:3.8.4:provided
[INFO] | | - org.codehaus.plexus:plexus-sec-dispatcher:jar:2.0:provided
[INFO] | | - org.codehaus.plexus:plexus-cipher:jar:2.0:provided
[INFO] | +- org.apache.maven:maven-repository-metadata:jar:3.8.4:provided
[INFO] | +- org.apache.maven:maven-plugin-api:jar:3.8.4:provided
[INFO] | +- org.apache.maven:maven-resolver-provider:jar:3.8.4:provided
[INFO] | +- org.apache.maven.resolver:maven-resolver-impl:jar:1.6.3:provided
[INFO] | +- org.apache.maven.resolver:maven-resolver-api:jar:1.6.3:provided
[INFO] | +- org.apache.maven.resolver:maven-resolver-spi:jar:1.6.3:provided
[INFO] | +- org.apache.maven.resolver:maven-resolver-util:jar:1.6.3:provided
[INFO] | +- org.apache.maven.shared:maven-shared-utils:jar:3.3.4:provided
[INFO] | | - commons-io:commons-io:jar:2.6:provided
[INFO] | +- com.google.inject:guice:jar:no_aop:4.2.2:provided
[INFO] | | +- aopalliance:aopalliance:jar:1.0:provided
[INFO] | | - com.google.guava:guava:jar:25.1-android:provided
[INFO] | | +- com.google.code.findbugs:jsr305:jar:3.0.2:provided
[INFO] | | +- org.checkerframework:checker-compat-qual:jar:2.0.0:provided
[INFO] | | +- com.google.errorprone:error_prone_annotations:jar:2.1.3:provided
[INFO] | | +- com.google.j2objc:j2objc-annotations:jar:1.1:provided
[INFO] | | - org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:provided
[INFO] | +- org.apache.commons:commons-lang3:jar:3.8.1:provided
[INFO] | - org.slf4j:slf4j-api:jar:1.7.32:provided
[INFO] +- org.eclipse.tycho:org.eclipse.tycho.p2.resolver.impl:jar:2.7.0:compile
[INFO] - org.eclipse.platform:org.eclipse.equinox.p2.metadata.repository:jar:1.4.0:compile
[INFO] - org.tukaani:xz:jar:1.9:compile (version selected from constraint [1.3,))

Please read eclipse-tycho/tycho#3573 (reply in thread) and eclipse-tycho/tycho#3573 (reply in thread) if Tycho is what bothers you.
If it's about version ranges in Eclipse projects published to Maven Central in general - we are aware that this is suboptimal but it's the best we can do with current manpower.
I'm closing this one as the issue is far bigger than p2 and it's the same state for Platform, Equinox, JDT and PDE. Publishing is done via https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/tree/master/eclipse.platform.releng/publish-to-maven-central which incl. mapping rules and etc. Help to streamline, simplify and make it more standard Maven would be more appreciated - just be aware that this is a long and multi-step process that is going on for years (slower than I wish but that's what time permits).

FYI, any artifact published more recently does not generally use version ranges for dependencies but rather specifies a dependency on the specific version being used for that release.

This was the last release (2022-09) with ranges:

https://repo1.maven.org/maven2/org/eclipse/platform/org.eclipse.core.runtime/3.26.0/org.eclipse.core.runtime-3.26.0.pom

and this was the first release (2022-12) without ranges:

https://repo1.maven.org/maven2/org/eclipse/platform/org.eclipse.core.runtime/3.26.100/org.eclipse.core.runtime-3.26.100.pom

In other words, this issue has already been addressed.