You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
application {
config {
applicationType monolith
baseName HelloMHipster
packageName hello.mhipster
clientTheme cyborg,
clientThemeVariant primary,
authenticationType oauth2
prodDatabaseType postgresql
buildTool gradle
cacheProvider caffeine
testFrameworks [protractor]
languages [en, de, fr]
}
entities *
}
entity Fish {
name String required minlength(3)
age Integer required min(0)
waterType WaterType required
picture Blob
}
entity School {
name String required
}
enum WaterType {
SALT, FRESH
}
relationship ManyToOne {
Fish{school(name)} to School
}
paginate Fish, School with pagination
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.
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Fish {
name String required minlength(3),
age Integer required min(0),
waterType WaterType required,
picture AnyBlob
}
entity School {
name String required
}
enum WaterType {
SALT,
FRESH
}
relationship ManyToOne {
Fish{school(name)} to School
}
paginate Fish, School with pagination
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
Checking this box is mandatory (this is just to show you read everything)
The text was updated successfully, but these errors were encountered:
The wrong jar might be selected if multiple jars are in the folder
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.
atomfrede
added a commit
to atomfrede/generator-jhipster-micronaut
that referenced
this issue
Apr 19, 2021
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?
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
The text was updated successfully, but these errors were encountered: