Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exportDatatables not working with jdk23 and gradle 8.10 as observed #618

Closed
nagkumar opened this issue Nov 7, 2024 · 4 comments · Fixed by openrewrite/rewrite-recipe-markdown-generator#141
Labels
bug Something isn't working question Further information is requested

Comments

@nagkumar
Copy link

nagkumar commented Nov 7, 2024

{15ABE437-B1E4-41C4-8B32-F5C28A31B5DA}

Script compilation error:

Line 65: exportDatatables = true
^ Cannot access 'exportDatatables': it is private in 'RewriteExtension'

1 error

@nagkumar nagkumar added the bug Something isn't working label Nov 7, 2024
@nagkumar
Copy link
Author

nagkumar commented Nov 7, 2024

@martintimko-kosik
Copy link

martintimko-kosik commented Nov 9, 2024

same for me. JDK 21, Gradle 8.10.2

plugins {
    ...
    id("org.openrewrite.rewrite") version("6.26.0")
}

dependencies {
    ...
    rewrite("org.openrewrite:rewrite-kotlin:1.21.2")
}

rewrite {
    activeRecipe("org.openrewrite.kotlin.cleanup.RemoveTrailingComma")
    exportDatatables = true
}

@timtebeek
Copy link
Contributor

timtebeek commented Nov 11, 2024

Hi both; thanks for the report! I've tried to replicate this with the spring-projects/spring-petclinic build.grade, but when I add the following I see no such issues:

diff --git a/build.gradle b/build.gradle
index a5175df..0f44c44 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,6 +6,8 @@ plugins {
   id 'org.cyclonedx.bom' version '1.10.0'
   id 'io.spring.javaformat' version '0.0.43'
   id "io.spring.nohttp" version "0.0.11"
+
+  id("org.openrewrite.rewrite") version("6.26.0")
 }
 
 apply plugin: 'java'
@@ -53,6 +55,13 @@ dependencies {
   testImplementation 'org.testcontainers:mysql'
   checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${springJavaformatCheckstyleVersion}"
   checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"
+
+  rewrite("org.openrewrite.recipe:rewrite-spring:5.22.0")
+}
+
+rewrite {
+  activeRecipe("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2")
+  exportDatatables = true
 }

Do note that this is with build.gradle, not build.gradle.kts. You might need to call a function to set that value, as in setExportDatatables(true), although I'm not sure there. But even then, you would only see changes in files other than your build scripts, pending:

@timtebeek
Copy link
Contributor

timtebeek commented Nov 11, 2024

I've given it a quick try and indeed setExportDatatables(true) seems to work for .kts files, but again: do not expect to see your dependencies updated yet. For that look towards the issue linked above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Archived in project
3 participants