问题
Let's say I have a Gradle Multi project with 2 subprojects, :profile
and :commons
.
:commons
is a Library project, and :profile
is a Spring Boot app, with details below:
# profile/build.gradle
...
dependencies {
implementation project(':commons')
...
}
...
And
# profile/settings.gradle
rootProject.name = 'profile'
include ":commons"
project(':commons').projectDir = new File('../commons')
Obviously, when I push to Heroku I have the error below:
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.
How can I include the :commons
Library project to Heroku build process ?
Thanks in advance.
Added details
Project hierarchy:
rootApp/
- commons/
- profile/
- settings.gradle
rootApp/settings.gradle
rootProject.name = 'root-app'
include ":profile"
include ":commons"
rootApp/profile/settings.gradle
rootProject.name = 'profile'
include ":commons"
project(':commons').projectDir = new File('../commons')
rootApp/profile/build.gradle
...
evaluationDependsOn(":commons")
dependencies {
implementation project(':commons')
...
}
...
rootApp/commons/settings.gradle
rootProject.name = 'commons'
来源:https://stackoverflow.com/questions/64891154/how-to-deploy-on-heroku-a-gradle-spring-boot-app-with-dependency-on-a-local-lib