gpt4 book ai didi

grails - Grails:如何将依赖项升级从2.x.x迁移到3.0.8?

转载 作者:行者123 更新时间:2023-12-02 15:56:43 54 4
gpt4 key购买 nike

我正在尝试将现有Grails应用程序从 2.4.4 版本升级到 3.0.8 版本。我有几个问题目前无法解决。

第一个问题:旧版本的BuildConfig.groovy引用了lib目录中的jar文件。我尝试将相同的配置从BuildConfig.groovy复制到build.gradle,并使用jar创建了一个lib目录,但是Grails无法解决依赖关系。

第二个问题:旧版本已定义了插件。我尝试将相同的插件定义从BuildConfig.groovy复制到build.gradle,但这不起作用。我注意到该插件当前未在Bintray中列出,这是问题吗?

以下是build.gradle文件的依赖项部分。

dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"

compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"

compile "com.stripe:stripe-java:1.32.1"
compile "com.google.code.gson:gson:2.3.1"
compile "javax.mail:mail:1.4"

runtime "org.grails.plugins:asset-pipeline"

testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"

// Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'

console "org.grails:grails-console"

//jar file located in lib directory
runtime "com.easypost:easypost-java:2.1.2"

//grails plugin
compile ":shiro:1.2.1"
}

在此先感谢您提供的任何指导。

最佳答案

问题1 :如果该jar是标准jar,并且您可以从maven引用它,那就很好了。但是,如果仍然需要从某个本地目录中包含它,则可以执行以下操作:

repositories {
flatDir {
//Directory path containing Jar
dirs 'libs'
}
}


dependencies {
//Jar File Name - No need to add suffix .jar
compile name: 'someJarFile'
}

问题2 :如果该插件未在Bintray中列出,则意味着该插件尚未针对Grails 3.x进行升级。您可以自己升级它,也可以删除插件。

关于grails - Grails:如何将依赖项升级从2.x.x迁移到3.0.8?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33422564/

54 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com