borinquenkid commented on code in PR #15972:
URL: https://github.com/apache/grails-core/pull/15972#discussion_r3565711302
##########
gradle.properties:
##########
@@ -40,6 +41,9 @@ jnrPosixVersion=3.1.20
joddWotVersion=3.3.8
joptSimpleVersion=5.0.4
jspApiVersion=4.0.0
+logbackClassicVersion=1.4.14
+neo4jDriverVersion=4.4.13
Review Comment:
Confirmed, thanks — marking this resolved.
##########
gradle/publish-root-config.gradle:
##########
@@ -138,6 +138,10 @@ def publishedProjects = [
// graphql
'grails-data-graphql',
'grails-data-graphql-core',
+ // neo4j
+ 'grails-data-neo4j',
+ 'grails-datastore-gorm-neo4j',
+ 'gorm-neo4j-spring-boot',
Review Comment:
Pushed — the branch head is now 6f5975bf51 (built on top of 059aad2f11), and
d580d61465 (`gorm-neo4j-spring-boot` → `grails-data-neo4j-spring-boot` rename)
is confirmed an ancestor of that tip. Please re-check when convenient.
##########
grails-data-neo4j/grails-datastore-gorm-neo4j/build.gradle:
##########
@@ -17,93 +17,122 @@
* 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.data'
+
+ext {
+ gormApiDocs = true
+ pomTitle = 'GORM for Neo4j'
+ pomDescription = 'Provides a GORM Object Mapping implementation for the
Neo4j Graph Database'
+}
+
sourceSets.main.java.srcDirs = []
sourceSets.main.groovy.srcDirs += ["src/main/java"]
dependencies {
+
+ implementation platform(project(':grails-bom'))
+
api "org.neo4j.driver:neo4j-java-driver:$neo4jDriverVersion"
- api
"org.apache.grails.data:grails-datamapping-validation:$datastoreVersion"
- api "org.apache.grails.data:grails-datamapping-core:$datastoreVersion"
+ api project(':grails-datamapping-validation')
+ api project(':grails-datamapping-core')
// only needed for web dependencies
- compileOnly "org.apache.grails.data:grails-datastore-web:$datastoreVersion"
+ compileOnly project(':grails-datastore-web')
compileOnly "org.neo4j.test:neo4j-harness:$neo4jVersion"
- implementation "org.javassist:javassist:$javassistVersion"
+ implementation 'org.javassist:javassist'
+
testImplementation "org.neo4j.test:neo4j-harness:$neo4jVersion"
- testImplementation
"org.apache.grails.data:grails-datamapping-core-test:$datastoreVersion"
- testImplementation
"org.apache.grails.data:grails-datamapping-tck-tests:$datastoreVersion"
- testImplementation
"org.hibernate:hibernate-validator:$hibernateValidatorVersion"
+ testImplementation project(':grails-datamapping-core-test')
+ testImplementation project(':grails-datamapping-tck')
+ testImplementation 'org.spockframework:spock-core'
+ testImplementation 'jakarta.validation:jakarta.validation-api'
+ testImplementation 'org.hibernate.validator:hibernate-validator'
testImplementation "org.codehaus.gpars:gpars:$gparsVersion"
- testImplementation "cglib:cglib-nodep:$cglibNodepVersion"
- testImplementation "org.objenesis:objenesis:${objenesisVersion}"
-
- testRuntimeOnly "org.springframework:spring-aop:$springVersion"
- testRuntimeOnly "ch.qos.logback:logback-classic:1.4.14"
- testRuntimeOnly "javax.el:javax.el-api:3.0.0"
- testRuntimeOnly "org.glassfish.web:el-impl:2.2.1-b05"
+ testImplementation 'org.objenesis:objenesis'
+
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
+
+ // Spock's Mock() support needs this at runtime but spock-core doesn't
declare it as a dependency
+ testRuntimeOnly "io.leangen.geantyref:geantyref:$geantyrefVersion"
+ testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking
support (cglib doesn't work on JDK 21+)
+ testRuntimeOnly 'org.springframework:spring-aop'
+ testRuntimeOnly "ch.qos.logback:logback-classic:$logbackClassicVersion"
+ testRuntimeOnly "jakarta.el:jakarta.el-api:$elApiVersion"
+ testRuntimeOnly
"org.glassfish.expressly:expressly:$defaultElImplementationVersion"
+}
+// The Spring Boot BOM (pulled in transitively via grails-bom) force-upgrades
Jetty to a
+// 12.x platform version and neo4j-java-driver to 6.x.
+def neo4jHarnessJettyVersion = '9.4.43.v20210629'
+
+// 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, since main code never touches Jetty directly.
+[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"
+ }
+}
+
+// This module's own main code (e.g. Neo4jQuery#executeQuery) calls
Driver#defaultTypeSystem(),
+// which driver 6.x removed - so this force applies to all configurations,
main and test alike.
+configurations.all {
+ resolutionStrategy {
+ force "org.neo4j.driver:neo4j-java-driver:$neo4jDriverVersion"
+ }
}
test {
useJUnitPlatform()
- maxParallelForks = configuredTestParallel
+ systemProperty('neo4j.gorm.suite', System.getProperty('neo4j.gorm.suite')
?: true)
+ maxParallelForks = (findProperty('maxTestParallel') as Integer) ?: 1
forkEvery = 10
- jvmArgs = ['-Xmx1028M']
- afterSuite {
- System.out.print('.')
- System.out.flush()
- }
+ // 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 = [
+ '-Xmx1028M',
+ '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
+ '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
+ ]
}
-test.doFirst {
- def toBaseClassRelativePathWithoutExtension = { String base, String
classFile ->
- if (classFile.startsWith(base)) {
- def sansClass = classFile[0 .. classFile.size() - ".class".size()
- 1]
- def dollarIndex = sansClass.indexOf('$')
- def baseClass = dollarIndex > 0 ? sansClass[0..dollarIndex - 1] :
sansClass
- def relative = baseClass - base - '/'
- relative
- }
- else {
- null
- }
- }
- def tckClassesFile = project
- .configurations
- .testCompileClasspath
- .resolvedConfiguration
- .getResolvedArtifacts()
- .find { resolved ->
- resolved.moduleVersion.id.name ==
'grails-datamapping-tck-tests'
- }.file
-
- def tckClassesDir = project.file("${project.buildDir}/tck")
- copy {
- from zipTree(tckClassesFile)
- into tckClassesDir
- }
- copy {
- from tckClassesDir
- into sourceSets.test.output.classesDirs.find {
it.path.contains('classes/groovy') }
- include "**/*.class"
- exclude { details ->
- // Do not copy across any TCK class (or nested classes of that
class)
- // If there is a corresponding source file in the particular
modules
- // test source tree. Allows a module to override a test/helper.
-
- if (!details.file.isFile()) {
- return false
- }
- def candidatePath = details.file.absolutePath
- def relativePath =
toBaseClassRelativePathWithoutExtension(tckClassesDir.absolutePath,
candidatePath)
-
- if (relativePath == null) {
- throw new IllegalStateException("$candidatePath does not
appear to be in the TCK")
- }
-
- project.file("src/test/groovy/${relativePath}.groovy").exists()
- }
- }
+apply {
+ from
rootProject.layout.projectDirectory.file('gradle/grails-data-tck-config.gradle')
+ from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle')
+}
+
+// This module predates the repo's Checkstyle/CodeNarc gate entirely: it was a
standalone Gradle
+// build (never included in root settings.gradle) until this PR wired it in,
so its Grails 3-era
+// source has never been checked against these rules. ~1,400 pre-existing
violations across the
+// module are tracked as a follow-up cleanup PR rather than fixed here -
codenarcFix's automated
+// fixes for SpaceAroundMapEntryColon/UnnecessaryGString are unsafe on this
module specifically,
+// since they rewrite string *contents* and this module embeds Cypher queries
in string literals
+// throughout (e.g. "MATCH (n:Label)"). Reports still generate; only
build-breaking is suppressed.
+tasks.withType(Checkstyle).configureEach {
+ ignoreFailures = true
Review Comment:
Pushed — dca3d09c6c (the 270-violation CodeNarc cleanup, module since
renamed to `grails-data-neo4j/core`) is confirmed an ancestor of the current
head, 6f5975bf51. Please re-check when convenient.
##########
settings.gradle:
##########
@@ -397,6 +414,16 @@
project(':grails-test-examples-mongodb-test-data-service').projectDir = new File
include 'grails-test-examples-mongodb-gson-templates'
project(':grails-test-examples-mongodb-gson-templates').projectDir = new
File(settingsDir, 'grails-test-examples/mongodb/gson-templates')
+// functional tests - neo4j examples
+include 'grails-test-examples-neo4j-grails3-neo4j'
Review Comment:
Pushed — a6aa7bd8cd (the neo4jFunctional CI job and publish gating) is
confirmed an ancestor of the current head, 6f5975bf51.
`.github/workflows/gradle.yml` now has the Neo4j references. Please re-check
when convenient.
##########
grails-data-neo4j/GORM_REGISTRY_MIGRATION.md:
##########
@@ -0,0 +1,181 @@
+# Neo4j → GormRegistry: migration plan
Review Comment:
The removal is on the pushed branch (current head 6f5975bf51). Nothing
further pending here — resolving.
##########
grails-data-neo4j/examples/test-data-service/build.gradle:
##########
@@ -1,37 +0,0 @@
-/*
Review Comment:
Pushed — both 0ca480de0d (`neo4j-standalone`) and 3afc76ae58
(`test-data-service`) are confirmed ancestors of the current head, 6f5975bf51.
`grails-test-examples/neo4j/` now has all five example apps. Please re-check
when convenient.
##########
settings.gradle:
##########
@@ -397,6 +414,16 @@
project(':grails-test-examples-mongodb-test-data-service').projectDir = new File
include 'grails-test-examples-mongodb-gson-templates'
project(':grails-test-examples-mongodb-gson-templates').projectDir = new
File(settingsDir, 'grails-test-examples/mongodb/gson-templates')
+// functional tests - neo4j examples
+include 'grails-test-examples-neo4j-grails3-neo4j'
+project(':grails-test-examples-neo4j-grails3-neo4j').projectDir = new
File(settingsDir, 'grails-test-examples/neo4j/grails3-neo4j')
Review Comment:
Pushed — e2e4522931 (Forge integration), 0163e87554
(`grails-datastore-gorm-neo4j` → `grails-data-neo4j-core`), and 7eedcb91cc
(example-app renames) are all confirmed ancestors of the current head,
6f5975bf51. `grails-forge/` now has the Neo4j feature and `settings.gradle`
uses the new module/example names. Please re-check when convenient.
##########
gradle/grails-data-tck-config.gradle:
##########
@@ -94,11 +94,13 @@ tasks.withType(Test).configureEach { Test it ->
return false
}
- if (project.hasProperty('onlySpringSecurityTests')) {
+ // Neo4j module names don't share a common prefix
(grails-datastore-gorm-neo4j predates
Review Comment:
These are already gone as of 0163e87554 (part of the naming-convention
cleanup, pushed at head 6f5975bf51) — that commit renamed
`grails-datastore-gorm-neo4j` to `grails-data-neo4j-core`, so the module now
does share the `grails-data-neo4j` prefix with its siblings. The
`.contains('neo4j')` workaround and its explanatory comment were removed at the
same time; the file now just uses
`project.name.startsWith('grails-data-neo4j')`, matching every other
datastore's block. Nothing left to rename here.
##########
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 {
Review Comment:
Fixed in 6f5975bf51 — extracted the identical `test{}`/Jetty-force block (it
was duplicated byte-for-byte across core, boot-plugin, and grails-plugin) into
a shared `grails-data-neo4j/gradle/neo4j-harness-test-config.gradle`, applied
via `apply from:` in all three modules. That matches the existing
reusable-config convention used elsewhere in the repo (e.g.
`gradle/grails-data-tck-config.gradle`, `gradle/docs-config.gradle`), just
scoped to `grails-data-neo4j/gradle/` since it's specific to these three
sibling modules rather than repo-wide.
core keeps its own small `test{}` block for the settings that aren't shared
(`systemProperty`, `maxParallelForks`, `forkEvery`, `-Xmx1028M`); the shared
file's `jvmArgs` now uses `+=` so it appends the add-opens flags without
clobbering core's own jvmArgs regardless of apply order.
##########
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
Review Comment:
Checked Maven Central: `org.neo4j.test:neo4j-harness` does have much newer
releases (up through `2026.06.0`), so newer-Jetty versions exist in principle.
But the versions currently pinned here (`neo4jVersion=3.5.35`,
`neo4jDriverVersion=4.4.13`) are both from around 2019, and jumping to a modern
Neo4j means a real migration, not a version bump: Neo4j 4.x introduced
multi-database support and reworked the embedded `GraphDatabaseService`/Bolt
APIs that `Neo4jSession`/`Neo4jEntityPersister`/`EmbeddedNeo4jServer` are built
against here, and the driver would need a matching major-version jump alongside
it.
I don't think that's in scope for this consolidation PR — it's a separate,
substantial upgrade project on its own. Happy to file a follow-up issue to
track it if that's useful; let me know.
--
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]