Technical Documentation: jhipster/generator-jhipster
โน๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference
Overview (`README.md`)
Greetings, Java Hipster!
Full documentation and information is available on our website at https://www.jhipster.tech.
Please read our guidelines before submitting an issue. If your issue is a bug, please use the bug template pre-populated here. For feature requests and queries you can use this template. If you have found a potential security issue, please read our security policy and contact us privately first: https://github.com/jhipster/generator-jhipster/security/policy
Before running the generator on a project you did not author, read the trust model of .yo-rc.json: the file's properties become part of the generated application, and blueprints declared in it are executed on your machine.
Contributing
We are honored by any contributions you may have small or large. Please refer to our contribution guidelines and instructions document for any information about contributing to the project.
Supported Java and Node versions
The following Java and Node combinations are tested and verified by GitHub Actions:
| Java | Node | Status |
|---|---|---|
| 21/25 | 22/24 | โ |
Sponsors
Support this project by becoming a sponsor! Become a sponsor or learn more about sponsoring the project.
Thank you to our sponsors!
Gold sponsors
Bronze sponsors
Backers
Thank you to all our backers!
Daily Builds
Additional builds at hipster-labs/jhipster-daily-builds
| Pipeline Status |
|---|
Analysis of the sample JHipster project
Overview (`.github/MAINTAINERS_REPLY_TEMPLATES/README.md`)
Reply templates for maintainers
Here is a list of common reply messages shared by core team members to help them respond to issues.
You can add those to your GitHub saved replies settings.
Overview (`generators/app/README.md`)
app sub-generator
jhipster command entrypoint, it composes with common, languages, server, and client.
Customizing
JHipster implementation allows you to override almost every aspect of the generation process.
SQL/spring-boot:data-relational customizations
Application
JDL doesn't support annotations, customizations must be done through local blueprint.
.blueprint/app/generator.mjs (to create a local blueprint follow https://www.jhipster.tech/modules/creating-a-blueprint/#local-blueprints):
get [Generator.PREPARING]() {
return {
customize({ application }) {
application.baseNameHumanized = 'Custom application title';
},
};
}Entities
Every annotation is loaded as entities properties and will be used at generation process.
@CustomsProp1(customValue)
entity Bar {}.jhipster/Bar.json:
{
"name": "Bar",
"annotations": {
"customsProp1": "customValue"
}
}Notable customizations
Label
@EntityClassHumanized("Departamento")
@EntityClassPluralHumanized("Departamentos")
entity Department {}Translation variant
Translation variant allows different translations for the entity whenever applicable.
@EntityI18nVariant('female')
@EntityClassHumanized("Empresa")
@EntityClassPluralHumanized("Empresas")
entity Company {}female variant is supported by pt-br locale.
Authority
Secure the entity with the authority.
@EntityAuthority(ROLE_ADMIN)
@EntityReadAuthority(ROLE_USER)
entity Department {}Admin Entity
Declare the entity as an admin entity like User and Authority.
The entity is added to the admin menu and secured with ROLE_ADMIN authority.
@AdminEntity
entity Department {}Fields
Notable customizations
Label
entity Company {
@FieldNameHumanized('Company Name')
company_name
}Relationships
Notable customizations
Label
relationship ManyToOne {
@RelationshipNameHumanized('Company user') Company{user} to User
}Eager loading relationships
Applicable to SQL/spring-data-relational with partial support at MongoDb/spring-data-mongodb.
Neo4j eager loads every relationship by default.
JHipster UI uses only the id and otherEntityFieldName properties, by default only fields used by the UI will be fetched.
relationship OneToMany {
@RelationshipEagerLoad Bar to @RelationshipEagerLoad Foo
}Related issues: #23917
Overview (`generators/liquibase/README.md`)
liquibase sub-generator
Adds support to liquibase to SQL databases and Neo4j.
Customizing
Customizing basics can be found at Customizing
Notable relationships customizations
OnUpdate/OnDelete
relationship ManyToOne {
A to @OnDelete("SET NULL") @OnUpdate("CASCADE") B
}Allowed values: NO ACTION | RESTRICT | CASCADE | SET NULL | SET DEFAULT
Overview (`generators/server/README.md`)
server sub-generator
Server generator.
Customizing
Entities
Notable customizations
Layers
Every layer is generated for every Entity by default.
It's possible to disable layers.
@EntityDomainLayer(false)
@EntityPersistenceLayer(false)
@EntityRestLayer(false)
entity OptionalLayers {}Overview (`generators/spring-boot/README.md`)
spring-boot sub-generator
Spring Boot generator.
Customizing
Entities
Notable customizations
Layers
Customize @PreAuthorize annotations at Rest layer.
Calculated using @EntityAuthority by default.
@EntitySpringPreAuthorize("hasAuthority('ROLE_CUSTOM')")
@EntitySpringReadPreAuthorize("hasAuthority('ROLE_CUSTOM_READ')")
entity CustomPreAuthorize {}Overview (`generators/upgrade/README.md`)
upgrade sub-generator
Upgrades the application to a newer generator-jhipster version.
The upgrade process generates 4 commits:
- the reference application
- a merge commit with unrelated histories
- the upgrade application
- a merge commit to apply the upgrade commit to the existing application
Upgrading from v7
To upgrade to v8 you need to upgrade to v7.9.4 before due to node v18/v20 compatibility.
If you use a blueprint that uses jhipster v7, you need to use jhipster-migrate.
Changing the application configuration
It's possible to apply configuration changes using the upgrade process.
For example to switch databases:
jhipster upgrade --apply-config --db postgresqlTo remove admin ui:
jhipster upgrade --apply-config --no-with-admin-uiFor more configuration options run:
jhipster app --helpOverview (`generators/java-simple-application/generators/openapi-generator/README.md`)
java:openapi-generator sub-generator
Generates openapi import structure that generates backend code using src/main/resources/swagger/api.yml openapi definition.
openapi-generator
openapi-generator-maven-plugin
openapi-generator-gradle-plugin
Overview (`generators/java/generators/gatling/README.md`)
Gatling sub-generator
Generates load testing simulations for entities using Gatling.
Logging tips
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
{
// Log all HTTP requests
//context.getLogger("io.gatling.http").setLevel(Level.valueOf("TRACE"));
// Log failed HTTP requests
//context.getLogger("io.gatling.http").setLevel(Level.valueOf("DEBUG"));
}Overview (`generators/spring-boot/generators/data-elasticsearch/README.md`)
spring-boot:data-elasticsearch sub-generator
Elasticsearch for Spring generator.
Customizing
Entities
Notable customizations
Search Layer
Disable the search service generation.
@EntitySearchLayer(false)
entity OptionalLayers {}Overview (`generators/spring-boot/generators/data-relational/README.md`)
SQL/spring-boot:data-relational sub-generator
Adds support to spring-boot:data-relational and provides sql related utilities.
Customizing
Customizing basics can be found at Customizing
Overview (`.blueprint/generate-sample/templates/test-integration/samples/README.md`)
Sample application generation
To generate test applications, either automatically by the CI or locally on the developer machine, a number of pre-defined configurations have been prepared.
Application configurations
Those are described in .yo-rc.json files which is the descriptor file created by Yeoman to keep track of the choices selected while generating an application.
- app-sample-dev: left empty for local testing, launching the generator with the VSCode debugger will generate an app in this folder
- jdl-default
- ms-micro-consul
- ms-micro-eureka
- ms-micro-eureka-infinispan
- ms-micro-eureka-jwt
- ms-ng-gateway-consul
- ms-ngx-gateway-eureka
- ms-ngx-gateway-eureka-jwt
- ms-ngx-gateway-eureka-oauth2
- ms-react-gateway-consul-jwt
- ms-react-gateway-consul-oauth2
- ngx-couchbase
- ngx-gradle-couchbase-search
- ngx-neo4j
- ngx-default
- ngx-gradle-fr
- ngx-gradle-mariadb-oauth2-infinispan
- ngx-gradle-mongodb-kafka-cucumber
- ngx-gradle-psql-es-noi18n-mapsid
- ngx-gradle-npm-h2disk-ws-nocache
- ngx-h2mem-ws-nol2
- ngx-mariadb-oauth2-infinispan
- ngx-mariadb-oauth2-sass-infinispan
- ngx-mongodb-kafka-cucumber
- ngx-psql-es-noi18n-mapsid
- ngx-session-cassandra-fr
- react-default
- react-gradle-cassandra-session-redis
- react-gradle-couchbase-caffeine
- react-gradle-h2mem-memcached
- react-gradle-psql-es-noi18n-mapsid
- react-maven-cassandra-session-redis
- react-maven-couchbase-caffeine
- react-maven-h2mem-memcached
- react-maven-psql-es-noi18n-mapsid
- react-noi18n-es-ws-gradle-session
- webflux-mongodb
- webflux-mongodb-oauth2
- webflux-mongodb-session
- webflux-gateway-jwt
- webflux-gateway-oauth2
- webflux-couchbase
- webflux-couchbase-session
- webflux-couchbase-oauth2
- webflux-mysql-kafka
- webflux-psql
Entity configurations
We also have a number of Entity.json files for testing different entity configurations.
--- METRICS ---
- Files Extracted: 12
- Estimated Token Budget: ~5364 tokens
- Canonical Reference: https://codewiki.google/github.com/jhipster/generator-jhipster
