Open vcupelloni opened 3 weeks ago
Does anyone know how I can inject the information about how many entities have been generated within the context so I can put a check in the build.gradle.ejs template?
The information is present in the yo-rc.json file but I don't know how to retrieve it cleanly.
Right now I am under the impression that the generator cannot be used out-of-the box or at least it generates broken code, am I wrong?
Overview of the issue
It seems that by creating a new microservice from scratch without entities and with User entity creation disabled, it cannot then be started due to an error in JPA's automatic entity scan.
Creating even a single entity with jhipster generator solves all the problems and the project can run.
Reproduce the error
Install JHipster and Micronaut blueprint, configure an application (in the screenshot I used microservice/postgresql/ehcache but itried several configuration with same results) , start the project after generation is completed.
Suggest a Fix
I am not aware of a parameter to disable JPA's autoscan, the only way I found to start the application is to comment out in the
build.gradle
file the dependency toio.micronaut.data:micronaut-data-hibernate-jpa
Is it feasible that this dependency will only be added if there is at least one entity?
Project configuration
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
Environment and Tools
openjdk version "21.0.4" 2024-07-16 OpenJDK Runtime Environment (build 21.0.4+7) OpenJDK 64-Bit Server VM (build 21.0.4+7, mixed mode, sharing)
git version 2.46.0
node: v18.19.1 npm: 10.2.4
Docker version 27.1.2, build d01f264bcc