VirtusLab / git-machete-intellij-plugin

Probably the sharpest git repository organizer & rebase/merge workflow automation tool you've ever seen
MIT License
134 stars 16 forks source link

`./gradlew build` fails with `kotlin-gradle-plugin` compatibility issue after updating Gradle to 7.6 #1360

Open mkondratek opened 1 year ago

mkondratek commented 1 year ago

Description

After the recent update of Gradle from 7.5.1 to 7.6 I cannot build the project. It fails with the exception given below:

Error

mkondratek@VL-D-1096 git-machete-intellij-plugin % ./gradlew build                 
> Task :buildSrc:compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSrc:compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':buildSrc:compileKotlin'.
   > Could not resolve all files for configuration ':buildSrc:kotlinCompilerPluginClasspathMain'.
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.10.
        Required by:
            project :buildSrc > org.jetbrains.kotlin:kotlin-sam-with-receiver:1.7.10
         > Unable to find a variant of org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.10 providing the requested capability org.jetbrains.kotlin:kotlin-gradle-plugin-api-gradle70:
              - Variant compile provides org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.10
              - Variant runtime provides org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.10
              - Variant sources provides org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.10
              - Variant javadoc provides org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.10
              - Variant platform-compile provides org.jetbrains.kotlin:kotlin-gradle-plugin-api-derived-platform:1.7.10
              - Variant platform-runtime provides org.jetbrains.kotlin:kotlin-gradle-plugin-api-derived-platform:1.7.10
              - Variant enforced-platform-compile provides org.jetbrains.kotlin:kotlin-gradle-plugin-api-derived-enforced-platform:1.7.10
              - Variant enforced-platform-runtime provides org.jetbrains.kotlin:kotlin-gradle-plugin-api-derived-enforced-platform:1.7.10

* 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
6 actionable tasks: 1 executed, 5 up-to-date

My setup:

mkondratek@VL-D-1096 git-machete-intellij-plugin % ./gradlew --version

------------------------------------------------------------
Gradle 7.6
------------------------------------------------------------

Build time:   2022-11-25 13:35:10 UTC
Revision:     daece9dbc5b79370cc8e4fd6fe4b2cd400e150a8

Kotlin:       1.7.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.5 (Amazon.com Inc. 17.0.5+8-LTS)
OS:           Mac OS X 13.0.1 x86_64

Tried so far...

I have tried https://github.com/VirtusLab/git-machete-intellij-plugin/blob/master/CONTRIBUTING.md#build suggestions - no success with them.

Workaround

Switch back to Gradle 7.5.1.

mkondratek commented 1 year ago

The Kotlin compiler settings confirmed with @PawelLipski (the same, but for him, the build works correctly):

image

mkondratek commented 1 year ago

./gradlew --version from @PawelLipski:

------------------------------------------------------------
Gradle 7.6
------------------------------------------------------------

Build time:   2022-11-25 13:35:10 UTC
Revision:     daece9dbc5b79370cc8e4fd6fe4b2cd400e150a8

Kotlin:       1.7.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          19.0.1 (Homebrew 19.0.1)
OS:           Mac OS X 13.0.1 aarch64

Note! The JVM version is different!

mkondratek commented 1 year ago

Nope, switching to 19.0.1 (Homebrew 19.0.1) did not help 😢

MaciejG604 commented 1 year ago

The build works for me, here's my version:

------------------------------------------------------------
Gradle 7.6
------------------------------------------------------------

Build time:   2022-11-25 13:35:10 UTC
Revision:     daece9dbc5b79370cc8e4fd6fe4b2cd400e150a8

Kotlin:       1.7.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17 (Oracle Corporation 17+35-2724)
OS:           Mac OS X 12.1 aarch64
PawelLipski commented 1 year ago

:goncern:

mkondratek commented 1 year ago

hmmm, I have not experienced this issue on any of three other mac books I had chance to use recently but it remains even after removing .gradle dir and cloning the repo again ... 🤔