Gradle:无法将 Hibernate 集成为依赖项
我只想将 Hibernate 作为依赖项集成到我的构建中。但我没有集成所有子模块,而是决定集成整个 hibernate 项目 (org.hibernate:hibernate:3.5.1-Final
)
问题:没有加载任何模块。
我的build.gradle
repositories {
mavenCentral()
mavenRepo urls: "http://repository.jboss.org/nexus/content/groups/public-jboss"
}
dependencies {
compile "org.hibernate:hibernate:3.5.1-Final"
}
gradle build的输出
Download http://repository.jboss.org/nexus/content/groups/public-jboss/org/hibernate/hibernate/3.5.1-Final/hibernate-3.5.1-Final.pom
Download http://repository.jboss.org/nexus/content/groups/public-jboss/org/hibernate/hibernate-parent/3.5.1-Final/hibernate-parent-3.5.1-Final.pom
有什么想法吗?
I just want to integrate Hibernate as a dependency in my build. But instead of integrating all submodules I desided to integrade the whole hibernate project (org.hibernate:hibernate:3.5.1-Final
)
The problem: No modules where loaded.
My build.gradle
repositories {
mavenCentral()
mavenRepo urls: "http://repository.jboss.org/nexus/content/groups/public-jboss"
}
dependencies {
compile "org.hibernate:hibernate:3.5.1-Final"
}
Output of gradle build
Download http://repository.jboss.org/nexus/content/groups/public-jboss/org/hibernate/hibernate/3.5.1-Final/hibernate-3.5.1-Final.pom
Download http://repository.jboss.org/nexus/content/groups/public-jboss/org/hibernate/hibernate-parent/3.5.1-Final/hibernate-parent-3.5.1-Final.pom
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须从工作项目中指定类似这些声明的子模块 https://github.com/nabeelalimemon/Gradle-enterprise-multiProject-/blob/master/domain/build.gradle
hibernateVersion = '3.6.0.Final' 不过。
然后您会遇到 slf4j/log4j 配置等问题,为此只需查看同一托管项目的主 build.gradle 即可。
You'll have to specify submodules like these declarations from a working project https://github.com/nabeelalimemon/Gradle-enterprise-multiProject-/blob/master/domain/build.gradle
hibernateVersion = '3.6.0.Final' though.
Then you'll come across issues like slf4j/log4j provision etc and for that just take a look at the master build.gradle of the same hosted project.
两件事:
1)你在问题标题中说了 3.5.1-Final,但在你的 build.gradle 中却说 3.5.3-Final。
2) 尝试在 Maven 存储库 URL 中将“public-jboss”切换为“public”
最终 URL 将如下所示:
http://repository.jboss.org/nexus/content/groups/public/org/hibernate /hibernate/3.5.1-Final/hibernate-3.5.1-Final.pom
或
http://repository.jboss.org/nexus/content/groups/public/org/hibernate/hibernate/3.5。 3-Final/hibernate-3.5.3-Final.pom
Two things:
1) You said 3.5.1-Final in the heading of your question, but it says 3.5.3-Final in your build.gradle.
2) Try to switch "public-jboss" by just "public" in the maven repo URL
The final URL will look like this:
http://repository.jboss.org/nexus/content/groups/public/org/hibernate/hibernate/3.5.1-Final/hibernate-3.5.1-Final.pom
or
http://repository.jboss.org/nexus/content/groups/public/org/hibernate/hibernate/3.5.3-Final/hibernate-3.5.3-Final.pom