generator-jhipster Documentation

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.

22,465 stars TypeScript TypeScript 1 file ยท ~5,452 tokens #angular#cloud#docker#generator#hacktoberfest#java#jhipster#kubernetes
RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy generator-jhipster on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name generator-jhipster --restart always jhipster/generator-jhipster:latest

Technical Documentation: jhipster/generator-jhipster

โ„น๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference

Overview (`README.md`)

Logo

NPM version Downloads Gitter Known Vulnerabilities

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

GoldSponsors

Bronze sponsors

BronzeSponsors

Backers

Thank you to all our backers!

Backers

Daily Builds

Additional builds at hipster-labs/jhipster-daily-builds

Pipeline Status
Angular Maven SQL
Angular Maven NoSQL
Angular Gradle SQL
Angular Gradle NoSQL
React Maven SQL
React Maven NoSQL
React Gradle SQL
React Gradle NoSQL
Vue Maven SQL
Vue Maven NoSQL
Vue Gradle SQL
Vue Gradle NoSQL
Elasticsearch
Monolith OAuth 2.0
No Database
Microservices JWT
Microservices OAuth 2.0
Docker Image
Official Windows

Analysis of the sample JHipster project

sonar-quality-gate sonar-coverage sonar-bugs sonar-vulnerabilities sonar-sample-code-smells-badge


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):

js
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.

jdl
@CustomsProp1(customValue)
entity Bar {}

.jhipster/Bar.json:

json
{
  "name": "Bar",
  "annotations": {
    "customsProp1": "customValue"
  }
}

Notable customizations

Label

text
@EntityClassHumanized("Departamento")
@EntityClassPluralHumanized("Departamentos")
entity Department {}

Translation variant

Translation variant allows different translations for the entity whenever applicable.

jdl
@EntityI18nVariant('female')
@EntityClassHumanized("Empresa")
@EntityClassPluralHumanized("Empresas")
entity Company {}

female variant is supported by pt-br locale.

Authority

Secure the entity with the authority.

text
@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.

text
@AdminEntity
entity Department {}

Fields

Notable customizations

Label

jdl
entity Company {
  @FieldNameHumanized('Company Name')
  company_name
}

Relationships

Notable customizations

Label

jdl
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.

jdl
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

jdl
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.

text
@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.

text
@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:

text
jhipster upgrade --apply-config --db postgresql

To remove admin ui:

text
jhipster upgrade --apply-config --no-with-admin-ui

For more configuration options run:

text
jhipster app --help

Overview (`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

text
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.

text
@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 ---