To use JHipster it is required to install some packages first, to be able to run JHipster as a developer. You will require:

  • maven (or gradle)
  • node.js
  • npm

Now it is crucial to decide what developer you are. Are you the a Windows, a Mac or Linux user?

Tutorial prerequisites

For this tutorial we will use JDK 17 LTS, maven as build tool and not gradle. To make it easier for us to manage it later, we use SDKMAN.

SDKMAN installation

Follow the instructions in Install SDKMAN

Java SDK installation

Run following command to get the available versions

sdk list java

in our case we want to use Java.net version and the latest 17.x version

sdk install java 17.0.2

maven installation

now install our required build tool maven. Usually the latest version is okay, anyway we stick to a specific tested version 3.8.5

sdk install maven 3.8.5

node.js and npm installation

Follow the instructions in Install node.js & npm with NVM

JHipster installation

Install JHipster as global npm package in a specific version in our case v7.8.1

npm install -g generator-jhipster@v7.8.1

JHipster first run

Let us get started with the first JHipster application.

Navigate to your folder where you save your projects

cd <yourProjectsFolder>

Prepare project folder

mkdir sampleJhipsterApp
cd sampleJhipsterApp

Generate the application

jhipster

Now you need to define a bunch of settings

Which *type* of application would you like to create? (Use arrow keys)

we use for now

Monolithic application (recommended for simple projects) 

and

What is the base name of your application? (sampleJhipsterApp)

hit return to accept

Do you want to make it reactive with Spring WebFlux? (y/N)

hit return to use No

What is your default Java package name? (com.mycompany.myapp)

we change this to

com.xenovation.samplejhipsterapp

and

Which *type* of authentication would you like to use? (Use arrow keys)

use

JWT authentication (stateless, with a token)
Which *type* of database would you like to use? (Use arrow keys)

use

SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL)

and

Which *production* database would you like to use? (Use arrow keys)

we use typically

PostgreSQL

and

Which *development* database would you like to use? (Use arrow keys)

use

H2 with disk-based persistence

and

Which cache do you want to use? (Spring cache abstraction) (Use arrow keys)

use

Ehcache (local cache, for a single node) 

and

Do you want to use Hibernate 2nd level cache? (Y/n)

hit return for yes

Would you like to use Maven or Gradle for building the backend? (Use arrow keys)

use

Maven

and

Do you want to use the JHipster Registry to configure, monitor and scale your application?

select yes

Yes

and

Which other technologies would you like to use? (Press <space> to select, <a> to toggle all, <i> to invert selection, 
and <enter> to proceed)

we use these both (ensure you select them both with space)

Elasticsearch as search engine
API first development using OpenAPI-generator

and

Which *Framework* would you like to use for the client? (Use arrow keys)

we require

Angular

and

Do you want to generate the admin UI? (Y/n)

we hit return to say yes

Would you like to use a Bootswatch theme (https://bootswatch.com/)? (Use arrow keys)

use

Cyborg

and

Choose a Bootswatch variant navbar theme (https://bootswatch.com/)? (Use arrow keys)

use

Primary

and

Would you like to enable internationalization support? (Y/n)

hit return to say yes

Please choose the native language of the application (Use arrow keys)

we select English

Please choose additional languages to install

we select German

German

and

Besides JUnit and Jest, which testing frameworks would you like to use?

we use cypress for frontend testing and Gatling for later load testing, along with cucumber for BDD tests

Cypress
Gatling
cucumber

and

Would you like to install other generators from the JHipster Marketplace?

hit return to choose No

Would you like to generate code coverage for Cypress tests? [Experimental] (y/N)

even if this feature would be great, it is too unstable for now.

After a few seconds/minutes your jhipster sample app is generated. But the dependency fetching of npm and maven can take ages. Depending on your network connection. Now it is time to take a short break and to grab a tea or coffee

First steps with you fresh generated app

Hopefully nothing went wrong. If you get an error during the generation, recheck if you have really all named versions running from this tutorial. We regularly face some odd issues, if versions do not match perfectly.

Let run the app

./mvnw

This may run again for a while, depending on your machine. And after finishing it starts a webserver which contains our app typically under


Share:

Facebook
Twitter
Pinterest
LinkedIn

Leave a Comment

Your email address will not be published. Required fields are marked *

Table of Contents

On Key

Related Posts