borinquenkid commented on code in PR #15972:
URL: https://github.com/apache/grails-core/pull/15972#discussion_r3565711558


##########
grails-data-neo4j/boot-plugin/build.gradle:
##########
@@ -17,27 +17,77 @@
  *  under the License.
  */
 
+plugins {
+    id 'groovy'
+    id 'java-library'
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    gormApiDocs = true
+}
+
 dependencies {
-    compileOnly "org.springframework.boot:spring-boot-cli:$springBootVersion", 
{
-        exclude group:'org.codehaus.groovy', module:'groovy'
-        exclude group:'jline', module:'jline'
-    }
 
-    api "org.springframework.boot:spring-boot-autoconfigure:$springBootVersion"
+    implementation platform(project(':grails-bom'))
 
-    api "org.codehaus.groovy:groovy"
-    api project(":grails-datastore-gorm-neo4j")
-    api "org.springframework:spring-tx:$springVersion"
+    api 'org.springframework.boot:spring-boot-autoconfigure'
+    // DispatcherServletAutoConfiguration (referenced via 
@AutoConfigureBefore) moved to spring-boot-webmvc.
+    api 'org.springframework.boot:spring-boot-webmvc'
+    api 'org.apache.groovy:groovy'
+    api project(':grails-datastore-gorm-neo4j')
+    api 'org.springframework:spring-tx'
 
     testRuntimeOnly "org.neo4j.test:neo4j-harness:$neo4jVersion"
-    testImplementation ("org.spockframework:spock-core:$spockVersion") {
-        exclude group: 'junit', module: 'junit-dep'
-        exclude group: 'org.codehaus.groovy', module: 'groovy-all'
-        exclude group: 'org.hamcrest', module: 'hamcrest-core'
-        transitive = false
+    testImplementation 'org.spockframework:spock-core'
+    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
+}
+
+test {
+    useJUnitPlatform()
+
+    // The embedded Neo4j 3.5.x test harness reflectively pokes JDK internals 
(Throwable's
+    // message field, sun.nio.ch.FileChannelImpl's lock accessors) at startup; 
JDK 9+ strong
+    // encapsulation blocks that without these opens.
+    jvmArgs = [
+            '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
+            '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
+    ]
+}
+
+// The Spring Boot BOM (pulled in transitively via grails-bom) force-upgrades 
Jetty to a 12.x
+// platform version. The embedded Neo4j 3.5.x test harness (neo4j-harness, 
test-only) is compiled
+// against Jetty 9.4 and is binary-incompatible with Jetty 12's restructured 
handler/server APIs.
+// Scoped to the test classpaths only, matching 
grails-datastore-gorm-neo4j/build.gradle.
+def neo4jHarnessJettyVersion = '9.4.43.v20210629'
+[configurations.testCompileClasspath, 
configurations.testRuntimeClasspath].each {
+    it.resolutionStrategy {
+        force "org.eclipse.jetty:jetty-server:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-servlet:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-webapp:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-security:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-http:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-io:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-util:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-util-ajax:$neo4jHarnessJettyVersion",
+                "org.eclipse.jetty:jetty-xml:$neo4jHarnessJettyVersion"
     }
-    testImplementation 
"org.springframework.boot:spring-boot-cli:$springBootVersion", {
-        exclude group:'org.codehaus.groovy', module:'groovy'
-        exclude group:'jline', module:'jline'
+}
+
+// grails-datastore-gorm-neo4j's own code (e.g. Neo4jQuery#executeQuery) calls
+// Driver#defaultTypeSystem(), which neo4j-java-driver 6.x (pulled in 
transitively via the Spring
+// Boot BOM) removed - so this module's test classpath needs the same force to 
actually exercise
+// that code path.
+configurations.all {
+    resolutionStrategy {
+        force "org.neo4j.driver:neo4j-java-driver:$neo4jDriverVersion"

Review Comment:
   Fixed in 6f5975bf51 — removed the local `configurations.all { 
resolutionStrategy { force "...neo4j-java-driver..." } }` block from all three 
modules (core, boot-plugin, grails-plugin), not just this one.
   
   Verified empirically before removing it: ran `dependencyInsight` for 
`neo4j-java-driver` on `grails-data-neo4j-core`'s `testRuntimeClasspath` with 
the force temporarily commented out, and it still resolved to `4.4.13` with 
selection reason "By constraint" / "By ancestor" only (no "Forced" reason). So 
`grails-bom`'s `strictly` constraint (`dependencies.gradle`) is sufficient on 
its own — the module-level force was redundant defense-in-depth that masked the 
fact the BOM was already doing the real work.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to