如何安装grails db-reverse-engineer

时间:2015-11-24 16:03:51

标签: grails

尝试使用Grails db-reverse-engineer plugin。由于此插件doesn't work with Grails 3我使用了SDKMAN到Grails的install older versions来生成模型。首先尝试的版本2.5.2(仍然与the tutorial不兼容)然后旋转回2.2.5。以下教程仍然无法安装插件:

$grails create-app reveng-test
| Created Grails Application at /home/user/pnvStuff/grails/reveng-test
$ cd reveng-test
$ grails install-plugin db-reverse-engineer
| Environment set to development.....
| Warning The install-plugin command is deprecated and may be removed from a future version of Grails.  Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy.  See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies.
| Error resolving plugin [name:db-reverse-engineer, group:org.grails.plugins, version:latest.integration]. Plugin not found.
| Error Plugin not found for name [db-reverse-engineer] and version [not specified]

我还尝试通过在BuildConfig.groovy的插件部分中引用插件来安装插件。

runtime ':db-reverse-engineer:0.5.1'

如何安装此插件以生成所需的域类?

1 个答案:

答案 0 :(得分:2)

Grails 2.x(以及1.x)此插件现在位于默认情况下未包含在BuildConfig.groovy中的存储库中。您需要将以下Maven仓库添加到依赖关系解析块。

grails.project.dependency.resolution = {
    repositories {
        mavenRepo "http://repo.grails.org/grails/repo/"

        ...