You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a continuation from #3420, since it doesn't look like it was addressed.
Background
I use Java 11 as the default system version, so my JAVA_HOME points to JDK 11. This is because I work with many projects that do not work with more recent Java versions, so for a few projects that need Java >17 it's easier for me to override the version on the project level in IDEA.
In the project where this bug happens, I've done just that - set my IDEA Project SDK to 20, and the IDEA Gradle JVM to 20, while keeping my JAVA_HOME pointing to JDK 11.
Bug
I'm able to build my specific project using Gradle from IDEA, since both Project SDK and Gradle JVM are set to JDK 20.
However, the SQLDelight IDE plugin tries to build the Gradle project using the Java version defined in JAVA_HOME, which is set to JDK 11, so the build fails.
I end up in a situation where my project can be successfully built in IDEA, but one of the IDEA plugins cannot build the project. I think it should be consistent - if the project is buildable in IDEA (i.e everything is green and Gradle sync executes without errors), the SQLDelight IDE plugin should be able to build it as well.
Proposal
The IDE plugin should use whatever JDK version IDEA uses to run Gradle tasks.
Steps to reproduce
Use Spring Boot 3 in a project by applying the org.springframework.boot Gradle plugin. Note: Spring Boot 3 does not work with Java < 17.
Set Project SDK to 20 (Project Structure -> Project -> SDK)
Set Gradle JVM to 20 (Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JVM)
Set the default system-wide Java version to 11, so that JAVA_HOME points to JDK 11.
Open a random .sqm file, witness the IDE plugin fail to connect to SQLDelight plugin, with the stacktrace mentioning variants and Java versions.
No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.4 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.3' but:
- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- 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 '8.3')
The text was updated successfully, but these errors were encountered:
SQLDelight Version
2.0.0
IDE Version
IntelliJ IDEA 2023.2.2 (Ultimate Edition)
Dialect
PostgreSQL
Describe the Bug
This is a continuation from #3420, since it doesn't look like it was addressed.
Background
I use Java 11 as the default system version, so my
JAVA_HOME
points to JDK 11. This is because I work with many projects that do not work with more recent Java versions, so for a few projects that need Java >17 it's easier for me to override the version on the project level in IDEA.In the project where this bug happens, I've done just that - set my IDEA Project SDK to 20, and the IDEA Gradle JVM to 20, while keeping my
JAVA_HOME
pointing to JDK 11.Bug
I'm able to build my specific project using Gradle from IDEA, since both Project SDK and Gradle JVM are set to JDK 20.
However, the SQLDelight IDE plugin tries to build the Gradle project using the Java version defined in
JAVA_HOME
, which is set to JDK 11, so the build fails.I end up in a situation where my project can be successfully built in IDEA, but one of the IDEA plugins cannot build the project. I think it should be consistent - if the project is buildable in IDEA (i.e everything is green and Gradle sync executes without errors), the SQLDelight IDE plugin should be able to build it as well.
Proposal
The IDE plugin should use whatever JDK version IDEA uses to run Gradle tasks.
Steps to reproduce
org.springframework.boot
Gradle plugin. Note: Spring Boot 3 does not work with Java < 17.JAVA_HOME
points to JDK 11..sqm
file, witness the IDE plugin fail to connect to SQLDelight plugin, with the stacktrace mentioning variants and Java versions.Stacktrace
Full stacktrace is here: gist.github.com/IgnatBeresnev/4e4f53a5c910aa2738a04d842f0238f7
Here's a part of it for indexing purposes:
The text was updated successfully, but these errors were encountered: