How to add a “non-mavenized” jar dependency to a grails project

前端 未结 2 1603
礼貌的吻别
礼貌的吻别 2020-12-28 08:43

I\'m a grails newby. I am using grails 2.0.3 from the command line (no IDE) on windows 7.

I am just running the \'hello world\' example from the grails documentatio

相关标签:
2条回答
  • 2020-12-28 08:50

    if your jar is in lib folder and also entry in buildconfig.groovy and if you can't find jar in your build path then try to use below command.

    grails compile --refresh-dependencies
    
    0 讨论(0)
  • 2020-12-28 08:51

    Grails 2.0-2.2

    Ok, I finally figured out what I need to do. Suppose my jar is named 'mylib.jar'. I need to rename it to mylib-1.0.jar and move it to the lib directory. Then I need to add the following to BuildConfig.groovy:

    dependencies {
            // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
    
            // runtime 'mysql:mysql-connector-java:5.1.16'
        runtime 'mylib:mylib:1.0'
        }
    

    I guess that was obvious to everyone but me. Hope this helps someone else.

    Grails 2.3-...

    Just put a jar into the lib/. Do not modify BuildConfig.groovy (c) kaskelotti

    0 讨论(0)
提交回复
热议问题