Skip to content

Fix Java 8 building and publishing#1822

Merged
wmdietl merged 8 commits into
masterfrom
java8-build
Jun 19, 2026
Merged

Fix Java 8 building and publishing#1822
wmdietl merged 8 commits into
masterfrom
java8-build

Conversation

@wmdietl

@wmdietl wmdietl commented Jun 19, 2026

Copy link
Copy Markdown
Member

A project that consumes Java 8 artifacts failed with:

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve io.github.eisop:checker:3.49.5-eisop2-SNAPSHOT.
     Required by:
         project :
      > Dependency resolution is looking for a library compatible with JVM runtime version 8, but 'io.github.eisop:checker:3.49.5-eisop2-SNAPSHOT' is only compatible with JVM runtime version 25 or newer.

* Try:
> Change the dependency on 'io.github.eisop:checker:3.49.5-eisop2-SNAPSHOT' to an earlier version that supports JVM runtime version 25.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

The first commit changed this to:

Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve io.github.eisop:checker:3.49.5-eisop2-SNAPSHOT.
     Required by:
         project :
      > No matching variant of io.github.eisop:checker:3.49.5-eisop2-SNAPSHOT was found. The consumer was configured to find a library for use during compile-time, compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
          - Variant 'shadowRuntimeElements' declares a library, compatible with Java 8, packaged as a jar, and its dependencies repackaged (shadow jar):
              - Incompatible because this component declares a component for use during 'shadow-runtime-elements' and the consumer needed a component for use during compile-time
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)

* Try:
> No matching variant errors are explained in more detail at https://docs.gradle.org/8.9/userguide/variant_model.html#sub:variant-no-match.
> Review the variant matching algorithm at https://docs.gradle.org/8.9/userguide/variant_attributes.html#sec:abm_algorithm.

With both commits this works again.

However:

  • We need a test case for this.
  • Is this the right fix?

@wmdietl wmdietl changed the title Java8 build Fix Java 8 building and publishing Jun 19, 2026
@wmdietl wmdietl enabled auto-merge (squash) June 19, 2026 19:29
@wmdietl wmdietl disabled auto-merge June 19, 2026 19:34
@wmdietl wmdietl enabled auto-merge (squash) June 19, 2026 19:34
@wmdietl wmdietl merged commit cf7e1d3 into master Jun 19, 2026
42 checks passed
@wmdietl wmdietl deleted the java8-build branch June 19, 2026 20:53
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.

1 participant