liquibase gradle插件找不到方法

时间:2017-10-19 19:40:54

标签: gradle jhipster liquibase

我正在尝试将liquibase插件添加到JHipster项目但是我收到错误:

Error:Could not find method liquibase() for arguments [org.liquibase.ext:liquibase-hibernate5:3.6] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

请告诉我,我该如何解决这个问题呢?

代码build.gradle:

import org.gradle.internal.os.OperatingSystem

buildscript {
    repositories {
        mavenLocal()
        jcenter()
        maven { url "http://repo.spring.io/plugins-release" }
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}"
        classpath "org.springframework.build.gradle:propdeps-plugin:0.0.7"
        classpath "gradle.plugin.org.liquibase:liquibase-gradle-plugin:1.2.4"
        //jhipster-needle-gradle-buildscript-dependency - JHipster will add additional gradle build script plugins here
    }
}

plugins {
    id "org.liquibase.gradle" version "1.2.4"
    //jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here
}


apply plugin: "org.liquibase.gradle"

1 个答案:

答案 0 :(得分:1)

我也用Jhipster生成了我的项目,并且必须对该行进行评论

apply from: 'gradle/liquibase.gradle'

并添加依赖项

classpath "org.liquibase.ext:liquibase-hibernate5:3.6"