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

Can't make diffChangelog work for Mariadb #104

Open
cvetan opened this issue Apr 5, 2022 · 0 comments
Open

Can't make diffChangelog work for Mariadb #104

cvetan opened this issue Apr 5, 2022 · 0 comments

Comments

@cvetan
Copy link

cvetan commented Apr 5, 2022

I have spring boot project with mariadb and I am trying to make plugin work, to generate changes from entities.

I followed instructions, with exception of driver, but also with mysql driver and always get the same error, when I try to generate changes:
Unexpected error running Liquibase: java.lang.RuntimeException: Driver class was not specified and could not be determined from the url (hibernate:spring:dev.cvetan.teachingschedule.entity?dialect=org.hibernate.dialect.MariaDB103Dialect)

build.gradle

plugins {
    id 'org.springframework.boot' version '2.6.6'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
    id 'org.liquibase.gradle' version '2.1.0'
}

group = 'dev.cvetan'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }

    liquibaseRuntime.extendsFrom runtime
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.liquibase:liquibase-core'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'

    liquibaseRuntime 'org.liquibase:liquibase-core:4.5.0'
    liquibaseRuntime 'org.liquibase:liquibase-groovy-dsl:3.0.0'
    liquibaseRuntime 'info.picocli:picocli:4.6.1'
    liquibaseRuntime 'org.mariadb.jdbc:mariadb-java-client'
    liquibaseRuntime 'ch.qos.logback:logback-core:1.2.3'
    liquibaseRuntime 'ch.qos.logback:logback-classic:1.2.3'
    liquibaseRuntime 'org.liquibase.ext:liquibase-hibernate5:3.6'
    liquibaseRuntime sourceSets.main.output
}

tasks.named('test') {
    useJUnitPlatform()
}

// configurations
bootRun {
    args = ["--spring.profiles.active=dev"]
}

diff.dependsOn compileJava
diffChangeLog.dependsOn compileJava

liquibase {
    activities {
        main {
            changelogFile "$projectDir/src/main/resources/db/changelog-master.yml"
            url 'jdbc:mariadb://localhost:3306/teaching-schedule'
            username 'root'
            password 'root'
            driver 'org.mariadb.jdbc.Driver'
            referenceUrl 'hibernate:spring:dev.cvetan.teachingschedule.entity?dialect=org.hibernate.dialect.MariaDB103Dialect'
        }
    }
}

Am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant