0

Getting below gradle build error while trying to upgrade java 17.

      - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
          - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11
          - Other compatible attribute:
              - Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')
      - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
          - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11
          - Other compatible attribute:
              - Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')

              - Doesn't say anything about its target Java version (required compatibility with Java 11)
              - Doesn't say anything about its elements (required them packaged as a jar)
              - Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')
  • Try:

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.

BUILD FAILED in 10s Error: The process '/azp/agent/_work/1/s/gradlew' failed with exit code 1 at ExecState._setResult (/azp/agent/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.221.0/node_modules/azure-pipelines-task-lib/toolrunner.js:943:25) at ExecState.CheckComplete (/azp/agent/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.221.0/node_modules/azure-pipelines-task-lib/toolrunner.js:926:18) at ChildProcess.<anonymous> (/azp/agent/_work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.221.0/node_modules/azure-pipelines-task-lib/toolrunner.js:839:19) at ChildProcess.emit (node:events:513:28) at maybeClose (node:internal/child_process:1093:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) Result Attachments will be stored in LogStore

  • SB3.x.x requires Java 17. Are you either using JDK11 or setting `sourceCompatibility` or `targetCompatibility` to J11? Also, check out this answer: https://stackoverflow.com/questions/72117858/incompatible-because-this-component-declares-a-component-compatible-with-java-11 – User51 Jun 15 '23 at 13:40
  • I am using sourceCompatibility = '17' targetCompatibility = '17' . the issue is not on my local. It is working fine on my local. The issue is in the build pipeline. Agent fails before it actually starts build process. – Rajeev Sharma Jun 16 '23 at 09:56

0 Answers0