Open atomfrede opened 3 years ago
Two things to notice:
So I will try to add change the build command and try to make sure there is only one jar in build/libs
afterwards, so most likely a dedicated command.
When thinking about it, maybe that is also the problem with the git deployment. There are multiple jars
in build/libs
and somehow heroku needs to choose one. Guess also the first, which is not the shadow jar.
Yes, I have hadn't noticed yet either that I would have a problem as soon as I bump the version with potentially having multiple jars. I suppose the workaround could be to add "clean" to the build command?
./gradlew clean assemble && heroku deploy:jar build/libs/*-all.jar
For the multiple jar thing I have a PR already. There seems to be a problem with the git deployment, regarding the frontend build https://github.com/jhipster/generator-jhipster-micronaut/pull/241/files
Overview of the issue
Deploying an app to heroku with gradle does not work out of box. Using git deployment seems to have no resources/frontend build, although the build is executed. Deploying via jar method does not build a correct shadow/executable jar, such that the frontend is not contained in the jar.
Doing
./gradlew assemble && heroku deploy:jar build/libs/*-all.jar
works fine.Reproduce the error
Use the following JDL
and do
mhipster import-jdl jhipster.jdl && mhipster heroku
and use jar deployment.Suggest a Fix
When doing jar deployment the wrong task seems to be executed as no shadow jar is created during that process and so the wrong jar is uploaded.
Project configuration
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "11.0.10" 2021-01-19 OpenJDK Runtime Environment (build 11.0.10+9) OpenJDK 64-Bit Server VM (build 11.0.10+9, mixed mode)
git version 2.31.1
node: v14.16.0
npm: 7.6.1
yarn: 1.22.10
Docker version 20.10.6, build 370c28948e
docker-compose version 1.29.1, build unknown