The security settings in src/main/resources/application.yml and src/main/resources/application-dev.xml are configured for this image.
spring:
...
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://localhost:5432/app
username: app
password: <password>The application depends on four external services: a database (postgres), an authentication server (Keycloak), a search server (elasticsearch) and a registry (using Netflix Zuul).
Bring up the dependent containers using this script:
./dependencies-up.sh
If you chose to use a locally running database you can skip running the postgres container.
Run the following commands to run microservice and serve the static front end content
./mvnw
(Optional) Run the following to get live-reload of front end content
npm start
To build the final jar and optimize the application for production, run:
./mvnw -Pprod clean verify
This will concatenate and minify the client CSS and JavaScript files. It will also modify index.html so it references these new files.
To ensure everything worked, run:
java -jar target/*.jar
Then navigate to http://localhost:8080 in your browser.
Refer to [Using JHipster in production][] for more details.
To package your application as a war in order to deploy it to an application server, run:
./mvnw -Pprod,war clean verify
To launch your application's tests, run:
./mvnw verify
Unit tests are run by [Jest][] and written with [Jasmine][]. They're located in src/test/javascript/ and can be run with:
npm test
Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with:
docker-compose -f src/main/docker/sonar.yml up -d
You can run a Sonar analysis with using the sonar-scanner or by using the maven plugin.
Then, run a Sonar analysis:
./mvnw -Pprod clean verify sonar:sonar
If you need to re-run the Sonar phase, please be sure to specify at least the initialize phase since Sonar properties are loaded from the sonar-project.properties file.
./mvnw initialize sonar:sonar