Please check our video tutorial on creating a new JHipster application!
First of all, create an empty directory in which you will create your application:
mkdir myapplication
Go to that directory:
cd myapplication/
To generate your application, type:
yo jhipster
Answer the questions asked by the generator to create an application taylored to your needs. Those options are described in the next section.
Once the application is generated, you can launch it using Maven (./mvnw on Linux/MacOS, mvnw.cmd on Windows) or Gradle (./gradlew on Linux/MacOS, gradelw.bat on Windows). You can go the Using JHipster in development page for more information.
./mvnw
mvnw.cmd
./gradlew
gradelw.bat
The application will be available on http://localhost:8080
Some questions change depending on the previous choices you have made. For example, you won’t need to configure an Hibernate cache if you didn’t select an SQL database.
Your type of application depends on whether you wish to use a microservices architecture or not. A full explanation on microservices is available here, if unsure use the default “Monolithic application”.
You can either use:
This is the name of your application.
Your Java application will use this as its root package. This value is stored by Yeoman so that the next time you run the generator the last value will become default. Of course you can override it by providing a new value.
The OAuth 2.0 and the JWT approaches allow to use a stateless application architecture (they do not rely on the HTTP Session). You can find more information on our securing your application page.
You can choose between:
This is the database you will use with your “production” profile. To configure it, please modify your src/main/resources/config/application-prod.yml file.
src/main/resources/config/application-prod.yml
If you want to use Oracle, you will need to install the Oracle JDBC driver manually.
This is the database you will use with your “development” profile. You can either use:
To configure it, please modify your src/main/resources/config/application-dev.yml file.
src/main/resources/config/application-dev.yml
Hibernate is the JPA provider used by JHipster. For performance reasons, we highly recommend you to use a cache, and to tune it according to your application’s needs. If you choose to do so, you can use either ehcache (local cache) or Hazelcast (distributed cache, for use in a clustered environnement)
Elasticsearch will be configured using Spring Data Elasticsearch. You can find more information on our Elasticsearch guide.
By default, JHipster uses a HTTP session only for storing Spring Security’s authentication and autorisations information. Of course, you can choose to put more data in your HTTP sessions. Using HTTP sessions will cause issues if you are running in a cluster, especially if you don’t use a load balancer with “sticky sessions”. If you want to replicate your sessions inside your cluster, choose this option to have Hazelcast configured.
Websockets can be enabled using Spring Websocket. We also provide a complete sample to show you how to use the framework efficiently.
You can build your generated Java application either with Maven or Gradle. Maven is more stable and more mature. Gradle is more flexible, easier to extend, and more hype.
Node-sass a great solution to simplify designing CSS. To be used efficiently, you will need to run a Gulp server, which will be configured automatically.
By default JHipster provides excellent internationalization support, both on the client side with Angular Translate and on the server side. However, internationalization adds a little overhead, and is a little bit more complex to manage, so you can choose not to install this feature.
By default JHipster provide Java unit/integration testing (using Spring’s JUnit support) and JavaScript unit testing (using Karma.js). As an option, you can also add support for:
You can find more information on our “Running tests” guide.
You can also run JHipster with some optional command-line options. Reference for those options can be found by typing yo jhipster --help.
yo jhipster --help
Here are the options you can pass:
--help
--skip-cache
--skip-install
--skip-client
yo jhipster:server
--skip-server
yo jhipster:client
--skip-user-management
--i18n
--with-entities
.jhipster
--check-install
If you are an advanced user you can use our client and server sub-generators by running yo jhipster:client --[options] and yo jhipster:server --[options]. Run the above sub-generators with --help flag to view all the options that can be passed.
yo jhipster:client --[options]
yo jhipster:server --[options]
You can also use the Yeoman command-line options, like --force to automatically overwrite existing files. So if you want to regenerate your whole application, including its entities, you can run yo jhipster --force --with-entities.
--force
yo jhipster --force --with-entities