@@ -107,6 +107,12 @@ export default class LiquibaseGenerator<
107107 // Generate h2 properties at master.xml for blueprints that uses h2 for tests or others purposes.
108108 application . liquibaseAddH2Properties ??= application . devDatabaseTypeH2Any ;
109109 } ,
110+ liquibaseNeo4j ( { application } ) {
111+ // TODO drop hardcoded version
112+ if ( application . databaseTypeNeo4j && application . javaManagedProperties [ 'liquibase.version' ] === '5.0.1' ) {
113+ application . javaDependencies [ 'liquibase-neo4j' ] = '5.0.0' ;
114+ }
115+ } ,
110116 checkDatabaseCompatibility ( { application } ) {
111117 if ( ! application . databaseTypeSql && ! application . databaseTypeNeo4j ) {
112118 throw new Error ( `Database type ${ application . databaseType } is not supported` ) ;
@@ -488,16 +494,16 @@ export default class LiquibaseGenerator<
488494 } ) ;
489495 }
490496
491- if ( relationalApplication . databaseTypeNeo4j ) {
492- if ( relationalApplication . backendTypeSpringBoot ) {
497+ if ( application . databaseTypeNeo4j ) {
498+ if ( application . backendTypeSpringBoot && ! application . springBoot4 ) {
493499 source . addMavenDependency ?.( [ { groupId : 'org.springframework' , artifactId : 'spring-jdbc' } ] ) ;
494500 }
495501 source . addMavenDependency ?.( [
496502 {
497503 groupId : 'org.liquibase.ext' ,
498504 artifactId : 'liquibase-neo4j' ,
499505 // eslint-disable-next-line no-template-curly-in-string
500- version : '${liquibase.version}' ,
506+ version : application . javaDependencies [ 'liquibase-neo4j' ] ?? '${liquibase.version}' ,
501507 // Exclude current neo4j driver and use the one provided by spring-data
502508 // See: https://github.com/jhipster/generator-jhipster/pull/24241
503509 additionalContent : `
@@ -548,6 +554,13 @@ export default class LiquibaseGenerator<
548554 { gradleFile : 'gradle/liquibase.gradle' } ,
549555 ) ;
550556 }
557+ if ( application . databaseTypeNeo4j && application . javaDependencies [ 'liquibase-neo4j' ] ) {
558+ source . addGradleDependencyCatalogLibrary ! ( {
559+ libraryName : 'liquibase-neo4j' ,
560+ module : 'org.liquibase.ext:liquibase-neo4j' ,
561+ version : application . javaDependencies [ 'liquibase-neo4j' ] ,
562+ } ) ;
563+ }
551564 } ,
552565 nativeHints ( { source, application } ) {
553566 if ( ! application . graalvmSupport ) return ;
0 commit comments