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

Reintroduce the maven (and gradle)-liquibase-maven-plugin snippet #24514

Closed
1 task done
Tcharl opened this issue Dec 8, 2023 · 2 comments
Closed
1 task done

Reintroduce the maven (and gradle)-liquibase-maven-plugin snippet #24514

Tcharl opened this issue Dec 8, 2023 · 2 comments

Comments

@Tcharl
Copy link
Contributor

Tcharl commented Dec 8, 2023

Overview of the feature request

mvn liquibase diff and other commands (snapshots, doc, ...) where really handy in fast evolving products, also the configuration is really hard to achieve by hand and was well done by the generator. Could it be possible to reintroduce?

Motivation for or Use Case

update database (not only for generate code, but also custom) incrementally was really helpful on many situations

  • Checking this box is mandatory (this is just to show you read everything)
@mshima
Copy link
Member

mshima commented Dec 9, 2023

Are you sure it’s removed?
https://github.com/jhipster/generator-jhipster/blob/main/generators/liquibase/support/maven-plugin.mts

source.addMavenDefinition?.({
properties: [
{ inProfile: 'no-liquibase', property: 'profile.no-liquibase', value: ',no-liquibase' },
{ property: 'profile.no-liquibase' },
{ property: 'liquibase.version', value: application.javaDependencies.liquibase },
{ property: 'liquibase-plugin.url' },
{ property: 'liquibase-plugin.username' },
{ property: 'liquibase-plugin.password' },
{ inProfile: 'dev', property: 'liquibase-plugin.url', value: applicationAny.devLiquibaseUrl },
{ inProfile: 'dev', property: 'liquibase-plugin.username', value: applicationAny.devDatabaseUsername },
{ inProfile: 'dev', property: 'liquibase-plugin.password', value: applicationAny.devDatabasePassword },
{ inProfile: 'prod', property: 'liquibase-plugin.url', value: applicationAny.prodLiquibaseUrl },
{ inProfile: 'prod', property: 'liquibase-plugin.username', value: applicationAny.prodDatabaseUsername },
{ inProfile: 'prod', property: 'liquibase-plugin.password', value: applicationAny.prodDatabasePassword },
],
pluginManagement: [
{
groupId: 'org.liquibase',
artifactId: 'liquibase-maven-plugin',
// eslint-disable-next-line no-template-curly-in-string
version: '${liquibase.version}',
additionalContent: mavenPlugin({
backendTypeSpringBoot: application.backendTypeSpringBoot,
reactive: application.reactive,
packageName: application.packageName,
srcMainResources: application.srcMainResources,
authenticationTypeOauth2: application.authenticationTypeOauth2,
devDatabaseTypeH2Any: applicationAny.devDatabaseTypeH2Any,
driver: liquibasePluginJdbcDriver,
hibernateDialect: liquibasePluginHibernateDialect,
defaultSchemaName: application.liquibaseDefaultSchemaName,
// eslint-disable-next-line no-template-curly-in-string
url: '${liquibase-plugin.url}',
// eslint-disable-next-line no-template-curly-in-string
username: '${liquibase-plugin.username}',
// eslint-disable-next-line no-template-curly-in-string
password: '${liquibase-plugin.password}',
}),
},

@mshima
Copy link
Member

mshima commented Dec 9, 2023

Gradle:

project.ext.diffChangelogFile = "<%= SERVER_MAIN_RES_DIR %>config/liquibase/changelog/" + new Date().format("yyyyMMddHHmmss") + "_changelog.xml"
if (!project.hasProperty("runList")) {
project.ext.runList = "main"
}
liquibase {
activities {
main {
driver "<%= devJdbcDriver %>"
url "<%- devLiquibaseUrl %>"
username "<%- devDatabaseUsername %>"
<%_ if (devDatabasePassword) { _%>
password "<%- devDatabasePassword %>"
<%_ } _%>
changelogFile "<%= SERVER_MAIN_RES_DIR %>config/liquibase/master.xml"
<%_ if (liquibaseDefaultSchemaName) { _%>
defaultSchemaName "<%- liquibaseDefaultSchemaName %>"
<%_ } _%>
logLevel "debug"
classpath "<%= SERVER_MAIN_RES_DIR %>"
}
diffLog {
driver "<%= devJdbcDriver %>"
url "<%- devLiquibaseUrl %>"
username "<%- devDatabaseUsername %>"
<%_ if (devDatabasePassword) { _%>
password "<%- devDatabasePassword %>"
<%_ } _%>
changelogFile project.ext.diffChangelogFile
<%_ if (!reactive && backendTypeSpringBoot) { _%>
referenceUrl "hibernate:spring:<%= packageName %>.domain?dialect=<%= devHibernateDialect %>&hibernate.physical_naming_strategy=org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy"
<%_ } _%>
<%_ if (liquibaseDefaultSchemaName) { _%>
defaultSchemaName "<%- liquibaseDefaultSchemaName %>"
<%_ } _%>
logLevel "debug"
classpath "$buildDir/classes/java/main"
<%_ if (authenticationTypeOauth2) { _%>

@mshima mshima closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2023
@deepu105 deepu105 added this to the 8.2.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants