gpt4 book ai didi

java - 无法解决对自制模块的依赖关系

转载 作者:太空宇宙 更新时间:2023-11-04 06:24:38 24 4
gpt4 key购买 nike

我有一个项目,由两个模块组成 - 核心模块和网络模块。核心模块包含一些领域类和服务,而Web模块则包含 Controller 和其他前端人员。如果我将 Controller 放入核心模块中,我可以执行grails run-app,然后通过 Chrome 浏览器中的 REST 插件直接访问我的服务。但是当 Controller 位于 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 模块的构建时,我总是收到以下错误:

|Loading Grails 2.4.3 |Configuring classpath Error | Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:myapp-core:zip:0.1-SNAPSHOT in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace) Error | Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:myapp-core:zip:0.1-SNAPSHOT in grailsCentral (hyperlink to repo.grails.org removed) (Use --stacktrace to see the full trace) Error | Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:myapp-core:zip:0.1-SNAPSHOT in grailsCentral (hyperlink to repo.grails.org removed) (Use --stacktrace to see the full trace) Error | Could not find artifact org.grails.plugins:myapp-core:zip:0.1-SNAPSHOT in grailsCentral (hyperlink to repo.grails.org removed) |Run 'grails dependency-report' for further information.

并且 myapp-core.zip 文件确实不存在于 .m2 存储库中。虽然它确实在那里创建了正确的目录链,但它只包含resolver-status.properties 文件。我浏览了 Grails 文档和 Manning 书籍,但仍然找不到解决方案。在带有 Maven 的普通 Java 中,这是小菜一碟,但在 Grails 中,尽管所有的人都声称它是多么简单和直接,但我还是在墙上撞了一周。

请帮帮我,请帮帮我。

最佳答案

您可以使用提到的grails.plugin.location in the docs或者你可以运行maven-install在本地安装。

关于java - 无法解决对自制模块的依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26963433/

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