Grails - 未找到数据库反向工程师插件 [英] Grails - Database Reverse Engineer plugin not found

查看:153
本文介绍了Grails - 未找到数据库反向工程师插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境

  Grails 2.4.4 
PostgreSQL 9.4
JDK 1.7
code>

我一直在试图让这个插件正常工作。 (我仍然是一个Grails新手,更不用说编程了。)



我试图尽我所能找到那里,但仍然得到这个密切的错误消息。

 加载Grails 2.4.4 
|配置classpath
|运行预编译脚本
|脚本 'DbReverseEngineer' 未找到,你的意思是:
1)SetVersion
2)GenerateRestfulController
3)GenerateViews
4)GenerateController
5)DbmGenerateChangelog
请选择或输入Q退出:

这就是我没有在我的配置中文件。 (我试图改变它们中的很多,例如Hibernate,插件版本等,但总是以这个消息结束。)

  grails.project.dependency.resolver =maven
grails.project.dependency.resolution = {
//继承Grails的默认依赖关系
inherits(global){
//在这里指定依赖项排除;例如,取消注释以禁用ehcache:
//排除'ehcache'
}
日志warn//常见问题解析器的日志级别,包括'error','warn',' info','debug'或'verbose'
checksums true //是否验证解析
上的校验和legacyResolve false //是否在插件安装时执行二级解析,不建议并且为了向后兼容

repositories {
inherits true //是否从插件继承存储库定义
$ b grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
//取消注释这些(或添加新的),以使公共Maven仓库
mavenRepoHTTP远程依赖解析://repository.codehaus。 org
// mavenRepohttp://download.java.net/maven/2/
mavenRepohttp://repo.grails.org/grails/repo/
MAVE nRepohttp://repository.jboss.com/maven2/
}

依赖关系{
//在'build','compile','运行时,测试或提供的范围
// runtime'mysql:mysql-connector-java:5.1.29'
testorg.grails:grails-datastore-test-support:1.0.2-grails-2.4

compileorg.grails.plugins:db-reverse-engineer:4.0.0

}

插件{
//仅用于构建系统的插件
build:tomcat:7.0.55

//编译步骤的插件
编译:脚手架:2.1.2
compile:cache:1.1.8'
compile:asset-pipeline:1.9.9
compile:postgresql-extensions:4.6.1
compile:jquery:1.11.1
compile:joda-time:1.5
compileorg.grails.plugins:db-reverse-engineer:4.0.0

//在运行时需要的插件但不用于编译
runtime:hibernate4:4.3.6.1//或:hibernate:3.6.10.18
runtime:database-迁移:1.4.0
运行时:jquery:1 .11.1
runtime:db-reverse-engineer:4.0.0



$ p
$ b

编辑1
因此,我在下更改了DbReverseEngineer.groovy,脚本文件夹就像这样。

  mergedConfig.driverClassName = dsConfig.driverClassName?:'org.postgresql。司机
mergedConfig.password = dsConfig.password: ''
mergedConfig.username = dsConfig.username:Postgres的
mergedConfig.url = dsConfig.url:JDBC:在PostgreSQL :// localhost:5432 / myApp'

我更改了插件 code>和依赖关系,每个Burt's和Emmanuel的建议。当我运行 grails db-reverse-engineer 命令时,我得到这个错误信息。

 编译错误:启动失败:
使用javac编译期间编译错误。
/home/Documents/Grails_Workspace/myApp/target/work/plugins/cache-1.1.8/src/java/grails/plugin/cache/web/GenericResponseWrapper.java:203:错误:方法不覆盖或实现从超
@覆盖
^
/home/Documents/Grails_Workspace/myApp/target/work/plugins/cache-1.1.8/src/java/grails/plugin/的方法cache / web / filter / PageFragmentCachingFilter.java:389:error:can not find symbol
contentType = response.getContentType();
^
符号:方法getContentType()
位置:HttpServletResponse类型的变量响应
注意:某些输入文件使用未经检查或不安全的操作。
注意:使用-Xlint重新编译:取消选中以获取详细信息。

这些错误意味着什么,我该如何摆脱它?
Thanks。

解决方案

你有两个相同的插件:


  1. compile'org.grails.plugins:db-reverse-engineer:4.0.0'

  2. runtime':db-reverse-engineer:4.0.0'

根据插件的页面,它应该被配置为编译时间依赖:

compileorg.grails.plugins:db -reverse-engineer:4.0.0



这个插件确实有声明丢失的命令。你可以看到它的此处。因此,您可能需要通过运行刷新依赖项:

grails刷新依赖项


Environment

Grails 2.4.4
PostgreSQL 9.4
JDK 1.7

I've been trying to get this plugin to work. (I'm still a grails newbie, not to mention programming.)

I tried to do everything I can find out there but still get this untimate error message.

Loading Grails 2.4.4
|Configuring classpath
|Running pre-compiled script
|Script 'DbReverseEngineer' not found, did you mean:
   1) SetVersion
   2) GenerateRestfulController
   3) GenerateViews
   4) GenerateController
   5) DbmGenerateChangelog
Please make a selection or enter Q to quit: 

This is what I have right not in my config files. (I've tried to change a lot of them, such as Hibernate, plugin version etc, but always end up with that message.)

grails.project.dependency.resolver = "maven" 
grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // specify dependency exclusions here; for example, uncomment this to disable ehcache:
        // excludes 'ehcache'
    }
    log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    checksums true // Whether to verify checksums on resolve
    legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility

    repositories {
        inherits true // Whether to inherit repository definitions from plugins

        grailsPlugins()
        grailsHome()
        mavenLocal()
        grailsCentral()
        mavenCentral()
        // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
        mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        mavenRepo "http://repo.grails.org/grails/repo/"
        mavenRepo "http://repository.jboss.com/maven2/"
    }

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
        // runtime 'mysql:mysql-connector-java:5.1.29'
        test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
        runtime "org.postgresql:postgresql:9.4-1205-jdbc41"
        compile "org.grails.plugins:db-reverse-engineer:4.0.0"

   }

    plugins {
        // plugins for the build system only
        build ":tomcat:7.0.55"

        // plugins for the compile step
        compile ":scaffolding:2.1.2"
        compile ':cache:1.1.8'
        compile ":asset-pipeline:1.9.9"
        compile ":postgresql-extensions:4.6.1"
        compile ":jquery:1.11.1"
        compile ":joda-time:1.5"
        compile "org.grails.plugins:db-reverse-engineer:4.0.0"

        // plugins needed at runtime but not for compilation
        runtime ":hibernate4:4.3.6.1"// or ":hibernate:3.6.10.18" 
        runtime ":database-migration:1.4.0"
        runtime ":jquery:1.11.1"
        runtime ":db-reverse-engineer:4.0.0"
  }

Thanks in advance.

EDIT 1 So, I changed DbReverseEngineer.groovy under Script folder like this.

mergedConfig.driverClassName = dsConfig.driverClassName ?: 'org.postgresql.Driver'
mergedConfig.password = dsConfig.password ?: ''
mergedConfig.username = dsConfig.username ?: 'postgres'
mergedConfig.url = dsConfig.url ?: 'jdbc:postgresql://localhost:5432/myApp'

And I changed plugin and dependency per Burt's and Emmanuel's advice. And when I run grails db-reverse-engineer command I get this error.

Compilation error: startup failed:
Compile error during compilation with javac.
/home/Documents/Grails_Workspace/myApp/target/work/plugins/cache-1.1.8/src/java/grails/plugin/cache/web/GenericResponseWrapper.java:203: error: method does not override or implement a method from a supertype
    @Override
    ^
/home/Documents/Grails_Workspace/myApp/target/work/plugins/cache-1.1.8/src/java/grails/plugin/cache/web/filter/PageFragmentCachingFilter.java:389: error: cannot find symbol
            contentType = response.getContentType();
                                  ^
  symbol:   method getContentType()
  location: variable response of type HttpServletResponse
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

What are those errors mean and how can I get rid of it? Thanks.

解决方案

You've got the same plugin set up twice:

  1. compile 'org.grails.plugins:db-reverse-engineer:4.0.0'
  2. runtime ':db-reverse-engineer:4.0.0'

According to the plugin's page it should be configured as a compile time dependency:

compile "org.grails.plugins:db-reverse-engineer:4.0.0"

The plugin does have the command that's claimed to be missing. You can see it here. So you may need to refresh the dependencies by running:

grails refresh-dependencies

这篇关于Grails - 未找到数据库反向工程师插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆