作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将现有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'
}
关于grails - Grails:如何将依赖项升级从2.x.x迁移到3.0.8?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33422564/
我是一名优秀的程序员,十分优秀!