Spring boot 如何在Heroku上部署Gradle Spring启动应用程序,并依赖于本地库项目?
假设我有一个Gradle多项目,有两个子项目,Spring boot 如何在Heroku上部署Gradle Spring启动应用程序,并依赖于本地库项目?,spring-boot,gradle,heroku,groovy,gradle-multi-project-build,Spring Boot,Gradle,Heroku,Groovy,Gradle Multi Project Build,假设我有一个Gradle多项目,有两个子项目,:profile和:commons。 :commons是一个库项目,:profile是一个Spring Boot应用程序,详细信息如下: # profile/build.gradle ... dependencies { implementation project(':commons') ... } ... 及 显然,当我推到Heroku时,我有以下错误: FAILURE: Build failed with an exception.
:profile
和:commons
。
:commons
是一个库项目,:profile
是一个Spring Boot应用程序,详细信息如下:
# profile/build.gradle
...
dependencies {
implementation project(':commons')
...
}
...
及
显然,当我推到Heroku时,我有以下错误:
FAILURE: Build failed with an exception.
remote:
remote: * What went wrong:
remote: Could not determine the dependencies of task ':compileJava'.
remote: > Could not resolve all task dependencies for configuration ':compileClasspath'.
remote: > Could not resolve project :commons.
remote: Required by:
remote: project :
remote: > No matching configuration of project :commons was found. The consumer was configured to find an API of a library compatible with Java 11, preferably in the form of class files, and its dependencies declared externally but:
remote: - None of the consumable configurations have attributes.
如何将:commons
库项目包括到Heroku构建过程中
提前谢谢
补充细节
项目层次结构:
rootApp/
- commons/
- profile/
- settings.gradle
rootApp/settings.gradle
rootProject.name = 'root-app'
include ":profile"
include ":commons"
rootProject.name = 'profile'
include ":commons"
project(':commons').projectDir = new File('../commons')
rootProject.name = 'commons'
rootApp/profile/settings.gradle
rootProject.name = 'root-app'
include ":profile"
include ":commons"
rootProject.name = 'profile'
include ":commons"
project(':commons').projectDir = new File('../commons')
rootProject.name = 'commons'
rootApp/profile/build.gradle
...
evaluationDependsOn(":commons")
dependencies {
implementation project(':commons')
...
}
...
rootApp/commons/settings.gradle
rootProject.name = 'root-app'
include ":profile"
include ":commons"
rootProject.name = 'profile'
include ":commons"
project(':commons').projectDir = new File('../commons')
rootProject.name = 'commons'
一个简单的多模块项目不应该让你如此头疼。乍一看,包含在子模块中看起来很奇怪。请提供项目根目录中的文件层次结构以及与gradle相关的文件(例如根目录中的settings.gradle)@cfrick,我刚刚添加了更多详细信息。我认为问题在于
:commons
项目不能作为远程依赖项使用。我应该推送本地commons.jar
文件吗?那么项目(':commons')
依赖关系呢?如果不重试这个确切的问题,我的猜测是:删除所有设置。gradle
,除了根目录中的设置,然后去掉evaluationDependesson(“:commons”)