Problem auf Github mit Umstellung auf Spring 3

8u3631984

Bekanntes Mitglied
Hallo. Ich habe folgenden Workflow :
Code:
name: check dependency updates
on:
  push:
  schedule:
    - cron: '0 3 * * *'
  workflow_dispatch:

jobs:
  dependencyUpdates:
    runs-on: ubuntu-latest

    steps:
      - name: setup gradle version
        uses: gradle/gradle-build-action@v2
        with:
          gradle-version: 7.6

      - name: setup python
        uses: actions/setup-python@v2
        with:
          python-version: 3.x

      - name: checkout code
        uses: actions/checkout@v3

      - name: check dependency updates
        run: gradle dependencyUpdates -DoutputFormatter=html

Hier ist meine build.gradle.kts :
Code:
plugins {
    java
    jacoco
    kotlin("jvm") version "1.8.21"
    id("org.springframework.boot") version "3.0.6"
   // id("io.spring.dependency-management") version "1.1.0"
    id("com.github.ben-manes.versions") version "0.46.0"
}

java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17

configurations {
    compileOnly {
        extendsFrom(configurations.annotationProcessor.get())
    }
}
dependencies {
    // ===============================================
    val springVersion = "3.0.6"
    implementation("org.springframework.boot:spring-boot-starter-web:$springVersion")
implementation("org.springframework.boot:spring-boot-starter-data-jpa:$springVersion")

developmentOnly("org.springframework.boot:spring-boot-devtools:$springVersion")

testImplementation("org.springframework.boot:spring-boot-starter-test:$springVersion")
// ===============================================
....


Wenn ich nun auf github die Actions ausführen lasse bekomme ich folgenden Fehler :
Code:
A problem occurred configuring root project 'media-manager'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.6.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.6
      > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.6 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.6' but:
          - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11
              - Other compatible attribute:

Dier Fehle rist est seit dem Umstieg auf Spring 3.0.6 aufgefallen. Zuvor (2.7.6) funktioniert es. Lokal (auf Windows) kann ich den Fehler nicht feststellen. Als IDE verwende ich Intellij. Kann mir jemand weiterhelefn ?
 
Steht doch da, er findet zwar was vom Namen her passendes, das braucht aber Java 17 und du verwendest Java 11

No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.6 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.6' but:
- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11

Wenn ich mir https://github.com/gradle/gradle-build-action ansehe - gib mal die Java Version in den Github Actions mit an. Oder schau noch ob irgendwo noch java 11 referenziert wird
 
Danke dir für deine Antwort. Ich werde das mal probieren.
Ich hatte angenommen, dass
Java:
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
ausreichend ist
 
Danke dir für deine Antwort. Ich werde das mal probieren.
Ich hatte angenommen, dass
Java:
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
ausreichend ist

Das erzaehlt Gradle was du gerne haettest, aber die Umgebung ist ja davon loesgeloest (es wird ja ein Container hergerichtet in dem dann Gradle laeuft auf einer JVM), da ist man in Gradle ja quasi zu spaet.
 

Zurück
Oben