无法解析对本地模块的依赖性

时间:2014-11-16 23:41:51

标签: java grails plugins dependencies

我有一个项目,包括两个模块 - 核心和网络。 核心模块包含一些域类和服务,而Web模块包含控制器和其他前端员工。 如果我将控制器放入核心模块,我可以执行 grails run-app ,然后通过Chrome浏览器中的REST插件直接访问我的服务。 但是当控制器在Web模块中时,我无法解决这些模块之间的依赖关系。 在我有

的网络模块的 BuildConfig.groovy
    plugins {
    // plugins for the build system only
    build ":tomcat:7.0.53"

    compile ":myapp-core:0.1-SNAPSHOT"

    // plugins for the compile step
    compile ":scaffolding:2.1.0"
    compile ':cache:1.1.6'
    compile ":asset-pipeline:1.9.6"
    compile ":angular-annotate-asset-pipeline:1.1.2"
    }
核心的

BuildConfig 如下所示:

grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"

grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked    compilation is required
//  compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],

// configure settings for the test-app JVM, uses the daemon by default
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the run-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the run-war JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the Console UI JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
//legacyResolve true
// 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'
repositories {
    grailsCentral()
    mavenLocal()
    mavenCentral()
    // uncomment the below to enable remote dependency resolution
    // from public Maven repositories
    //mavenRepo "http://repository.codehaus.org"
    //mavenRepo "http://download.java.net/maven/2/"
    //mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
            compile 'com.hazelcast:hazelcast:3.3.2'
}

plugins {

    // plugins for the build system only
    build ":tomcat:7.0.52.1"

    //plugin for consuming REST web services
    compile ":rest-client-builder:1.0.3"

    //plugin for consuming REST web services            
    build(":release:3.0.1") {
        export = false
    }
  }

}

当我为web模块运行构建时,我总是遇到以下错误:

  

|加载Grails 2.4.3   |配置类路径   错误|   解决错误获取依赖关系:找不到工件org.grails.plugins:myapp-core:zip:0.1-SNAPSHOT in grailsCentral(http://repo.grails.org/grails/plugins)(使用--stacktrace查看完整跟踪)   错误|   解决错误获取依赖关系:无法找到工件org.grails.plugins:myapp-core:zip:0.1-SNAPSHOT in grailsCentral(删除了repo.grails.org的超链接)(使用--stacktrace查看完整跟踪)   错误|   解决错误获取依赖关系:无法找到工件org.grails.plugins:myapp-core:zip:0.1-SNAPSHOT in grailsCentral(删除了repo.grails.org的超链接)(使用--stacktrace查看完整跟踪)   错误|   找不到工件org.grails.plugins:myapp-core:zip:0.1-SNAPSHOT in grailsCentral(删除了repo.grails.org的超链接)   |运行'grails dependency-report'以获取更多信息。

myapp-core.zip文件确实不存在于.m2存储库中。 虽然它确实在那里创建了正确的目录链,但它只包含resolver-status.properties文件。 我浏览了Grails文档和Manning书,但仍无法找到解决方案。 在简单的旧Java与maven中它是一块蛋糕,但在Grails中,尽管所有人都声称这是多么容易和直截了当,但我还是在这个墙上撞了一个星期。

请帮助我,拜托。

1 个答案:

答案 0 :(得分:1)

您可以按照in the docs使用grails.plugin.location,也可以运行maven-install在本地安装。

相关问题