gpt4 book ai didi

grails - Grails Postgresql数据库连接

转载 作者:行者123 更新时间:2023-12-02 13:51:32 25 4
gpt4 key购买 nike

刚开始Grails。经历了所有问题,但仍然是问题所在。
连接器似乎就位。

BuildConfig的存储库

 repositories {
inherits true // Whether to inherit repository definitions from plugins

grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
// uncomment these (or add new ones) 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/"
//mavenRepo "http://repo1.maven.org/maven2/"
}

数据源
dataSource {
pooled = true
jmxExport = true
driverClassName = "org.postgresql.Driver"
username = "postgres"
password = "password"
}

environments {
development {
dataSource {
dbCreate = "update"
url = "jdbc:postgresql://localhost:5433/dev1base"
}
}

我得到这个:
|Loading Grails 2.4.3
|Configuring classpath
Error |
Resolve error obtaining dependencies: Could not find artifact postgresql:postgresql:jar:9.3- 1100.jdbc4 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Could not find artifact postgresql:postgresql:jar:9.3-1100.jdbc4 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
Error |
Could not find artifact postgresql:postgresql:jar:9.3-1100.jdbc4 in grailsCentral (http://repo.grails.org/grails/plugins)
|Run 'grails dependency-report' for further information.

这里不应该有魔术。

最佳答案

问题在于 Artifact 的格式。它应该是:

runtime 'org.postgresql:postgresql:9.3-1100-jdbc41'

请注意,最后一段应改为破折号。

关于grails - Grails Postgresql数据库连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26664379/

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