我在windows中使用grails2.3.7。
我想开发一个grails-plugin schedulePlugin,它应该与另一个grails插件dbPlugin一起工作。
我的schedulePlugin构建配置
grails.project.dependency.resolver="ivy"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
legacyResolve true // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
mavenRepo 'http://repo.spring.io/milestone'
}
dependencies {
}
plugins {
runtime ':hibernate:3.6.10.10'
build(
":tomcat:7.0.50.1",
":release:2.2.1",
":rest-client-builder:1.0.3") {
export = false
}
//Own
compile ":grails-dbPlugin:2.0-A6"
}我的dbPlugin构建配置
grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
mavenRepo "http://repo.grails.org/grails/libs-releases/" //Added this repo to resolve plugin dependencies for hibernate, joda, zk & quartz.
mavenRepo 'http://repo.spring.io/milestone'
}
dependencies {
}
plugins {
compile ":audit-logging:1.0.1"
compile ":database-migration:1.3.8"
runtime ":hibernate:3.6.10.10"
build(":release:3.0.1"
,":rest-client-builder:1.0.3"
,":tomcat:7.0.50.1") {
export = false
}
}
}当我编译schedulePlugin时,会出现编译错误
| Error Compilation error: startup failed:
C:\projects\scheduler\target\work\plugins\dbPlugin-2.0-A6\grails-app\migrations\init-changelog.groovy: 1: unable to resolve class liquibase.statement.core.
@ line 1, column 1.
import liquibase.statement.core.InsertStatement如果我将编译“:数据库迁移:1.3.8”添加到BuildConfig of schedulePlugin,则可以解决此错误。
但是它不应该自动继承dbPlugin的依赖项。在这种情况下,某个人能帮助解决依赖关系吗?
谢谢
发布于 2014-07-31 16:38:49
您可以在插件描述符文件中声明正式的插件依赖项。例如,如果我的插件名为arkDashboard,那么描述符文件就是插件项目根目录中的ArkDashboardGrailsPlugin.groovy。下面是另一个名为“arkCore”的插件的依赖声明示例:
// Plugins that we are dependent on
def dependsOn = [
"arkCore": "1.2.2 > *"
]描述符文件应该已经在您的插件项目中(由Grails创建),本节已经删除。你只要填一下就行了。有关插件依赖性解析的详细信息,请参阅手册中的Plugins部分。
这有点让人困惑,因为您可以使用BuildConfig.groovy文件中的显式规则来“修复”依赖项,但是您的直觉是正确的,如果可以的话,您应该将它留给依赖项解决。这样代码就不那么易碎了。
发布于 2014-10-06 14:27:49
看起来你遇到了和我一样的问题。在我看来,问题似乎源于这样一个事实:你的应用程序使用“常春藤”解析器,而插件使用"maven“解析器。
发布于 2015-01-09 19:54:57
地理位置插件的BuildConfig.groovy中有一个运行时依赖项。
runtime 'com.javadocmd:simplelatlng:1.0.0' 您可以检查源代码这里。
现在,只需将其添加到应用程序的依赖项中,它就能工作了。
https://stackoverflow.com/questions/25058739
复制相似问题