JHipster Generator
JHipster is an open-source development platform used to quickly generate, develop, and deploy modern web applications and microservices. It combines popular frontend frameworks like Angular, React, and Vue with a robust Spring Boot backend, supporting various database options and authentication mechanisms. The current stable version is 9.0.0, released in late 2024. JHipster follows a rapid release cadence, with several minor and patch releases within major versions, and new major versions introducing significant technology stack upgrades (e.g., Spring Boot 4, Angular 21, React 19 in v9). Its key differentiators include comprehensive full-stack generation with production-ready defaults, extensive customization options via a powerful CLI, and strong support for microservices architectures, making it suitable for enterprise-grade applications. The project recently underwent a complete TypeScript rewrite for its generator core, enhancing maintainability and developer experience.
Common errors
-
Cannot find package 'yeoman-test'
cause An issue in `generator-jhipster@9.0.0-beta.1` caused `yeoman-test` to be incorrectly resolved when the generator was installed globally.fixUpgrade `generator-jhipster` to version `9.0.0-beta.3` or any subsequent stable release (e.g., `npm install -g generator-jhipster@latest`). -
Maximum call stack size exceeded
cause A bug in the `chevrotain` dependency used by `generator-jhipster@9.0.0-beta.2` led to stack overflow errors during JDL file parsing.fixUpgrade `generator-jhipster` to version `9.0.0-beta.3` or any subsequent stable release (e.g., `npm install -g generator-jhipster@latest`).
Warnings
- breaking JHipster v9 introduces significant technology stack upgrades, including Spring Boot 4, Angular 21 (with zoneless by default), React 19 (replacing reactstrap with react-bootstrap), minimum Java 21, and minimum Node.js 22. Existing projects must update their environment and potentially migrate codebases.
- breaking React applications generated with JHipster v9 now use `react-bootstrap` instead of `reactstrap`. This change requires refactoring any custom React components that previously relied on `reactstrap`'s API or components.
- breaking Angular applications generated with JHipster v9 are now zoneless by default. This significantly changes change detection mechanisms and might require adjustments to code that explicitly relied on Zone.js, particularly for third-party libraries or manual change detection triggers.
- gotcha Version 9.0.0-beta.1 was broken, causing the CLI to fail with 'Cannot find package 'yeoman-test'' errors when installed globally.
- gotcha Version 9.0.0-beta.2 was broken, leading to 'Maximum call stack size exceeded' errors when parsing JDL (JHipster Domain Language) files.
Install
-
npm install generator-jhipster -
yarn add generator-jhipster -
pnpm add generator-jhipster
Imports
- JHipsterGenerator
const JHipsterGenerator = require('generator-jhipster');import { JHipsterGenerator } from 'generator-jhipster'; - type JHipsterApplicationConfiguration
import { JHipsterApplicationConfiguration } from 'generator-jhipster';import type { JHipsterApplicationConfiguration } from 'generator-jhipster'; - JDLParser
import JDLParser from 'generator-jhipster/lib/jdl-parser';
import { JDLParser } from 'generator-jhipster';
Quickstart
// Quickstart for JHipster v9.0.0
// This demonstrates the typical setup and generation of a JHipster application.
// 1. Install Yeoman globally if you haven't already.
// Yeoman is the scaffolding tool that runs JHipster generators.
console.log('Installing Yeoman globally...');
// npm install -g yo
// 2. Install the JHipster generator globally.
console.log('Installing JHipster generator globally...');
// npm install -g generator-jhipster
// 3. Create a new directory for your application and navigate into it.
// mkdir myapp
// cd myapp
// 4. Run the JHipster generator. This will start an interactive prompt
// where you can configure your application's type, technologies, and features.
console.log('Running JHipster generator...');
// yo jhipster
// During the interactive process, you'll be asked questions such as:
// - Which type of application would you like to create? (Monolithic, Microservice, Gateway)
// - Which front-end framework would you like to use? (Angular, React, Vue)
// - Which type of authentication would you like to use? (JWT, OAuth 2.0, Session)
// - Which database would you like to use? (SQL, MongoDB, Cassandra, etc.)
// - Which build tool would you like to use? (Maven, Gradle)
// After generation, you can run your application.
console.log('JHipster application generated. To run:');
console.log(' cd myapp');
console.log(' ./mvnw (for Maven) or ./gradlew (for Gradle) to build and run the backend.');
console.log(' npm start or yarn start (in the frontend folder) to run the frontend.');
// This provides a full-stack application ready for development.