Repository: jhipster/generator-jhipster
Pull request #7970 (2018-07-15 08:21:56)

CICD: improvement
Fix https://github.com/jhipster/generator-jhipster/issues/7904
Fix https://github.com/jhipster/generator-jhipster/issues/7978

All changes are listed here: https://github.com/jhipster/generator-jhipster/issues/7904#issue-337273283

All tests I did:
- Maven + Angular project:
    - Travis CI with sonarcloud.io analyze + Heroku deployment
    - GitLab CI with sonarcloud.io analyze + Heroku deployment
    - Jenkins with Artifactory + Sonar
- Gradle + React project:
    - Travis CI with sonarcloud.io analyze + Heroku deployment
    - GitLab CI with sonarcloud.io analyze + Heroku deployment
    - Jenkins with Sonar

_____

- Please make sure the below checklist is followed for Pull Requests.

- [ ] [Travis tests](https://travis-ci.org/jhipster/generator-jhipster/pull_requests) are green
- [ ] Tests are added where necessary
- [ ] Documentation is added/updated where necessary
- [ ] Coding Rules & Commit Guidelines as per our [CONTRIBUTING.md document](https://github.com/jhipster/generator-jhipster/blob/master/CONTRIBUTING.md) are followed

<!--
Please also reference the issue number in a commit message to [automatically close the related Github issue](https://help.github.com/articles/closing-issues-via-commit-messages/)

Note: It is also possible to add `[skip ci]` to your commit message to skip Travis tests
-->



Patch:
diff --git a/Dockerfile b/Dockerfile
index 8762ed8f9b..54f9600119 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,9 +20,45 @@ RUN \
     fontconfig \
     python \
     g++ \
-    libpng-dev \
-    build-essential && \
-
+    build-essential \
+  # dependencies required by puppeteer
+    gconf-service \
+    libasound2 \
+    libatk1.0-0 \
+    libc6 \
+    libcairo2 \
+    libcups2 \
+    libdbus-1-3 \
+    libexpat1 \
+    libfontconfig1 \
+    libgcc1 \
+    libgconf-2-4 \
+    libgdk-pixbuf2.0-0 \
+    libglib2.0-0 \
+    libgtk-3-0 \
+    libnspr4 \
+    libpango-1.0-0 \
+    libpangocairo-1.0-0 \
+    libstdc++6 \
+    libx11-6 \
+    libx11-xcb1 \
+    libxcb1 \
+    libxcomposite1 \
+    libxcursor1 \
+    libxdamage1 \
+    libxext6 \
+    libxfixes3 \
+    libxi6 \
+    libxrandr2 \
+    libxrender1 \
+    libxss1 \
+    libxtst6 \
+    ca-certificates \
+    fonts-liberation \
+    libappindicator1 \
+    libnss3 \
+    lsb-release \
+    xdg-utils && \
   # install node.js
   curl -sL https://deb.nodesource.com/setup_8.x | bash && \
   apt-get install -y nodejs && \
diff --git a/generators/ci-cd/index.js b/generators/ci-cd/index.js
index 4316bed733..c213619b9f 100644
--- a/generators/ci-cd/index.js
+++ b/generators/ci-cd/index.js
@@ -17,9 +17,10 @@
  * limitations under the License.
  */
 const chalk = require('chalk');
+const _ = require('lodash');
 const prompts = require('./prompts');
 const BaseGenerator = require('../generator-base');
-
+const packagejs = require('../../package.json');
 const constants = require('../generator-constants');
 
 module.exports = class extends BaseGenerator {
@@ -44,15 +45,19 @@ module.exports = class extends BaseGenerator {
     get initializing() {
         return {
             sayHello() {
-                this.log(chalk.white('Welcome to the JHipster CI/CD Sub-Generator'));
+                this.log(chalk.white('🚀 Welcome to the JHipster CI/CD Sub-Generator 🚀'));
             },
             getConfig() {
+                this.jhipsterVersion = packagejs.version;
                 this.baseName = this.config.get('baseName');
                 this.applicationType = this.config.get('applicationType');
                 this.skipClient = this.config.get('skipClient');
                 this.clientPackageManager = this.config.get('clientPackageManager');
                 this.buildTool = this.config.get('buildTool');
                 this.herokuAppName = this.config.get('herokuAppName');
+                if (this.herokuAppName === undefined) {
+                    this.herokuAppName = _.kebabCase(this.baseName);
+                }
                 this.clientFramework = this.config.get('clientFramework');
                 this.testFrameworks = this.config.get('testFrameworks');
                 this.autoconfigureTravis = this.options['autoconfigure-travis'];
@@ -74,7 +79,7 @@ module.exports = class extends BaseGenerator {
 
     get prompting() {
         return {
-            askPipelines: prompts.askPipelines,
+            askPipeline: prompts.askPipeline,
             askIntegrations: prompts.askIntegrations
         };
     }
@@ -87,31 +92,45 @@ module.exports = class extends BaseGenerator {
                 insight.trackWithEvent('generator', 'ci-cd');
             },
             setTemplateConstants() {
-                if (this.abort || this.jenkinsIntegrations === undefined) return;
-                this.gitLabIndent = this.jenkinsIntegrations.includes('gitlab') ? '    ' : '';
-                this.indent = this.jenkinsIntegrations.includes('docker') ? '    ' : '';
+                if (this.abort || this.cicdIntegrations === undefined) return;
+                this.gitLabIndent = this.sendBuildToGitlab ? '    ' : '';
+                this.indent = this.insideDocker ? '    ' : '';
                 this.indent += this.gitLabIndent;
             }
         };
     }
 
     writing() {
-        if (this.pipelines.includes('jenkins')) {
+        if (this.pipeline === 'jenkins') {
             this.template('jenkins/Jenkinsfile.ejs', 'Jenkinsfile');
             this.template('jenkins/jenkins.yml.ejs', `${this.DOCKER_DIR}jenkins.yml`);
             this.template('jenkins/idea.gdsl', `${this.SERVER_MAIN_RES_DIR}idea.gdsl`);
-            if (this.jenkinsIntegrations.includes('publishDocker')) {
-                this.template('docker-registry.yml.ejs', `${this.DOCKER_DIR}docker-registry.yml`);
-            }
         }
-        if (this.pipelines.includes('gitlab')) {
+        if (this.pipeline === 'gitlab') {
             this.template('.gitlab-ci.yml.ejs', '.gitlab-ci.yml');
         }
-        if (this.pipelines.includes('circle')) {
+        if (this.pipeline === 'circle') {
             this.template('circle.yml.ejs', 'circle.yml');
         }
-        if (this.pipelines.includes('travis')) {
+        if (this.pipeline === 'travis') {
             this.template('travis.yml.ejs', '.travis.yml');
         }
+
+        if (this.cicdIntegrations.includes('deploy')) {
+            if (this.buildTool === 'maven') {
+                this.addMavenDistributionManagement(
+                    this.artifactorySnapshotsId, this.artifactorySnapshotsUrl,
+                    this.artifactoryReleasesId, this.artifactoryReleasesUrl
+                );
+            } else if (this.buildTool === 'gradle') {
+                // TODO: add support here
+                // this.addGradleDistributionManagement(this.artifactoryId, this.artifactoryName);
+                this.warning('No support for Artifactory yet, when using Gradle.\n');
+            }
+        }
+
+        if (this.cicdIntegrations.includes('publishDocker')) {
+            this.template('docker-registry.yml.ejs', `${this.DOCKER_DIR}docker-registry.yml`);
+        }
     }
 };
diff --git a/generators/ci-cd/prompts.js b/generators/ci-cd/prompts.js
index cb1ccc7e26..384529cf60 100644
--- a/generators/ci-cd/prompts.js
+++ b/generators/ci-cd/prompts.js
@@ -16,139 +16,217 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+const chalk = require('chalk');
+
 module.exports = {
-    askPipelines,
+    askPipeline,
     askIntegrations
 };
 
-function askPipelines() {
+function askPipeline() {
     if (this.abort) return;
     if (this.autoconfigureTravis) {
         this.log('Auto-configuring Travis CI');
-        this.pipelines = ['travis'];
+        this.pipeline = 'travis';
         return;
     }
     if (this.autoconfigureJenkins) {
         this.log('Auto-configuring Jenkins');
-        this.pipelines = ['jenkins'];
+        this.pipeline = 'jenkins';
+        this.sendBuildToGitlab = false;
+        this.insideDocker = false;
         return;
     }
     const done = this.async();
     const prompts = [
         {
-            type: 'checkbox',
-            name: 'pipelines',
+            type: 'list',
+            name: 'pipeline',
             message: 'What CI/CD pipeline do you want to generate?',
-            default: [],
+            default: 'jenkins',
             choices: [
                 { name: 'Jenkins pipeline', value: 'jenkins' },
-                { name: 'Travis CI', value: 'travis' },
                 { name: 'GitLab CI', value: 'gitlab' },
-                { name: 'CircleCI', value: 'circle' }
+                { name: 'Travis CI', value: 'travis' }
             ]
         }
     ];
     this.prompt(prompts).then((props) => {
-        if (props.pipelines.length === 0) {
-            this.abort = true;
-        }
-        this.pipelines = props.pipelines;
+        this.pipeline = props.pipeline;
         done();
     });
 }
 
 function askIntegrations() {
-    if (this.abort || this.pipelines.length === 0) return;
+    if (this.abort || !this.pipeline) return;
     if (this.autoconfigureTravis) {
-        this.heroku = [];
+        this.cicdIntegrations = [];
         return;
     }
     if (this.autoconfigureJenkins) {
-        this.heroku = [];
-        this.jenkinsIntegrations = [];
+        this.cicdIntegrations = [];
+        this.sendBuildToGitlab = false;
+        this.insideDocker = false;
         return;
     }
     const done = this.async();
-    const herokuChoices = [];
-    if (this.pipelines.includes('jenkins')) {
-        herokuChoices.push({ name: 'In Jenkins pipeline', value: 'jenkins' });
-    }
-    if (this.pipelines.includes('gitlab')) {
-        herokuChoices.push({ name: 'In GitLab CI', value: 'gitlab' });
-    }
-    if (this.pipelines.includes('circle')) {
-        herokuChoices.push({ name: 'In CircleCI', value: 'circle' });
-    }
-    if (this.pipelines.includes('travis')) {
-        herokuChoices.push({ name: 'In Travis CI', value: 'travis' });
-    }
-
     const prompts = [
         {
-            when: this.pipelines.includes('jenkins'),
+            when: this.pipeline === 'jenkins',
+            type: 'confirm',
+            name: 'insideDocker',
+            message: 'Would you like to perform the build in a Docker container ?',
+            default: false
+        },
+        {
+            when: this.pipeline === 'gitlab',
+            type: 'confirm',
+            name: 'insideDocker',
+            message: 'In GitLab CI, perform the build in a docker container (hint: GitLab.com uses Docker container) ?',
+            default: false
+        },
+        {
+            when: this.pipeline === 'jenkins',
+            type: 'confirm',
+            name: 'sendBuildToGitlab',
+            message: 'Would you like to send build status to GitLab ?',
+            default: false
+        },
+        {
+            when: this.pipeline === 'jenkins',
+            type: 'checkbox',
+            name: 'cicdIntegrations',
+            message: 'What tasks/integrations do you want to include ?',
+            default: [],
+            choices: [
+                { name: `Deploy your application to an ${chalk.yellow('*Artifactory*')}`, value: 'deploy' },
+                { name: `Analyze your code with ${chalk.yellow('*Sonar*')}`, value: 'sonar' },
+                { name: `Build and publish a ${chalk.yellow('*Docker*')} image`, value: 'publishDocker' },
+                { name: `Deploy to ${chalk.yellow('*Heroku*')} (requires HEROKU_API_KEY set on CI service)`, value: 'heroku' }
+            ]
+        },
+        {
+            when: this.pipeline === 'gitlab',
+            type: 'checkbox',
+            name: 'cicdIntegrations',
+            message: 'What tasks/integrations do you want to include ?',
+            default: [],
+            choices: [
+                { name: `Deploy your application to an ${chalk.yellow('*Artifactory*')}`, value: 'deploy' },
+                { name: `Analyze your code with ${chalk.yellow('*Sonar*')} (requires SONAR_TOKEN set on CI service)`, value: 'sonar' },
+                { name: `Deploy to ${chalk.yellow('*Heroku*')} (requires HEROKU_API_KEY set on CI service)`, value: 'heroku' }
+            ]
+        },
+        {
+            when: this.pipeline === 'travis',
             type: 'checkbox',
-            name: 'jenkinsIntegrations',
-            message: 'Jenkins pipeline: what tasks/integrations do you want to include?',
+            name: 'cicdIntegrations',
+            message: 'What tasks/integrations do you want to include?',
             default: [],
             choices: [
-                { name: 'Perform the build in a Docker container', value: 'docker' },
-                { name: 'Analyze code with Sonar', value: 'sonar' },
-                { name: 'Send build status to GitLab', value: 'gitlab' },
-                { name: 'Build and publish a Docker image', value: 'publishDocker' }
+                { name: `Analyze your code with ${chalk.yellow('*Sonar*')} (requires SONAR_TOKEN set on CI service)`, value: 'sonar' },
+                { name: `Deploy to ${chalk.yellow('*Heroku*')} (requires HEROKU_API_KEY set on CI service)`, value: 'heroku' }
             ]
         },
         {
-            when: response => this.pipelines.includes('jenkins') && response.jenkinsIntegrations.includes('sonar'),
+            when: response => response.cicdIntegrations.includes('deploy'),
+            type: 'input',
+            name: 'artifactorySnapshotsId',
+            message: `${chalk.yellow('*Artifactory*')}: what is the ID of distributionManagement for snapshots ?`,
+            default: 'snapshots'
+        },
+        {
+            when: response => response.cicdIntegrations.includes('deploy'),
+            type: 'input',
+            name: 'artifactorySnapshotsUrl',
+            message: `${chalk.yellow('*Artifactory*')}: what is the URL of distributionManagement for snapshots ?`,
+            default: 'http://artifactory:8081/artifactory/libs-snapshot'
+        },
+        {
+            when: response => response.cicdIntegrations.includes('deploy'),
+            type: 'input',
+            name: 'artifactoryReleasesId',
+            message: `${chalk.yellow('*Artifactory*')}: what is the ID of distributionManagement for releases ?`,
+            default: 'releases'
+        },
+        {
+            when: response => response.cicdIntegrations.includes('deploy'),
+            type: 'input',
+            name: 'artifactoryReleasesUrl',
+            message: `${chalk.yellow('*Artifactory*')}: what is the URL of distributionManagement for releases ?`,
+            default: 'http://artifactory:8081/artifactory/libs-release'
+        },
+        {
+            when: response => this.pipeline === 'jenkins' && response.cicdIntegrations.includes('sonar'),
+            type: 'input',
+            name: 'sonarName',
+            message: `${chalk.yellow('*Sonar*')}: what is the name of the Sonar server ?`,
+            default: 'sonar'
+        },
+        {
+            when: response => this.pipeline !== 'jenkins' && response.cicdIntegrations.includes('sonar'),
             type: 'input',
-            name: 'jenkinsSonarName',
-            message: 'What is the name of the Sonar server?',
-            default: 'Sonar'
+            name: 'sonarUrl',
+            message: `${chalk.yellow('*Sonar*')}: what is the URL of the Sonar server ?`,
+            default: 'https://sonarcloud.io'
         },
         {
-            when: response => this.pipelines.includes('jenkins') && response.jenkinsIntegrations.includes('publishDocker'),
+            when: response => this.pipeline !== 'jenkins' && response.cicdIntegrations.includes('sonar'),
+            type: 'input',
+            name: 'sonarOrga',
+            message: `${chalk.yellow('*Sonar*')}: what is the Organization of the Sonar server ?`,
+            default: ''
+        },
+        {
+            when: response => response.cicdIntegrations.includes('publishDocker'),
             type: 'input',
             name: 'dockerRegistryURL',
-            message: 'What is the URL of the Docker registry?',
+            message: `${chalk.yellow('*Docker*')}: what is the URL of the Docker registry ?`,
             default: 'https://registry.hub.docker.com'
         },
         {
-            when: response => this.pipelines.includes('jenkins') && response.jenkinsIntegrations.includes('publishDocker'),
+            when: response => response.cicdIntegrations.includes('publishDocker'),
             type: 'input',
             name: 'dockerRegistryCredentialsId',
-            message: 'What is the Jenkins Credentials ID for the Docker registry?',
+            message: `${chalk.yellow('*Docker*')}: what is the Jenkins Credentials ID for the Docker registry ?`,
             default: 'docker-login'
         },
         {
-            when: response => this.pipelines.includes('jenkins') && response.jenkinsIntegrations.includes('publishDocker'),
+            when: response => response.cicdIntegrations.includes('publishDocker'),
             type: 'input',
             name: 'dockerRegistryOrganizationName',
-            message: 'What is the Organization Name for the Docker registry?',
+            message: `${chalk.yellow('*Docker*')}: what is the Organization Name for the Docker registry ?`,
             default: 'docker-login'
         },
         {
-            when: this.pipelines.includes('gitlab'),
-            type: 'confirm',
-            name: 'gitlabUseDocker',
-            message: 'In GitLab CI, perform the build in a docker container (hint: GitLab.com uses Docker container)?',
-            default: false
-        },
-        {
-            when: (this.pipelines.includes('jenkins') || this.pipelines.includes('gitlab') || this.pipelines.includes('circle') || this.pipelines.includes('travis')) && this.herokuAppName,
-            type: 'checkbox',
-            name: 'heroku',
-            message: 'Deploy to heroku (requires HEROKU_API_KEY set on CI service)?',
-            default: [],
-            choices: herokuChoices
+            when: response => response.cicdIntegrations.includes('heroku'),
+            type: 'input',
+            name: 'herokuAppName',
+            message: `${chalk.yellow('*Heroku*')}: name of your Heroku Application ?`,
+            default: `${this.herokuAppName}`
         }
     ];
     this.prompt(prompts).then((props) => {
-        this.jenkinsIntegrations = props.jenkinsIntegrations;
-        this.jenkinsSonarName = props.jenkinsSonarName;
+        this.cicdIntegrations = props.cicdIntegrations;
+
+        this.artifactorySnapshotsId = props.artifactorySnapshotsId;
+        this.artifactorySnapshotsUrl = props.artifactorySnapshotsUrl;
+        this.artifactoryReleasesId = props.artifactoryReleasesId;
+        this.artifactoryReleasesUrl = props.artifactoryReleasesUrl;
+
+        this.sonarName = props.sonarName;
+        this.sonarUrl = props.sonarUrl;
+        this.sonarOrga = props.sonarOrga;
+
+        this.publishDocker = props.publishDocker;
         this.dockerRegistryURL = props.dockerRegistryURL;
         this.dockerRegistryCredentialsId = props.dockerRegistryCredentialsId;
         this.dockerRegistryOrganizationName = props.dockerRegistryOrganizationName;
-        this.gitlabUseDocker = props.gitlabUseDocker;
-        this.heroku = props.heroku;
+
+        this.insideDocker = props.insideDocker;
+
+        this.sendBuildToGitlab = props.sendBuildToGitlab;
+
         done();
     });
 }
diff --git a/generators/ci-cd/templates/.gitlab-ci.yml.ejs b/generators/ci-cd/templates/.gitlab-ci.yml.ejs
index 95f248127b..c6f6f40901 100644
--- a/generators/ci-cd/templates/.gitlab-ci.yml.ejs
+++ b/generators/ci-cd/templates/.gitlab-ci.yml.ejs
@@ -16,15 +16,14 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -%>
-<%_ if (gitlabUseDocker) { _%>
-image: openjdk:8
+<%_ if (insideDocker) { _%>
+image: jhipster/jhipster:v<%= jhipsterVersion %>
 <%_ } _%>
 
 <%_ if (buildTool === 'gradle') { _%>
 cache:
     key: "$CI_COMMIT_REF_NAME"
     paths:
-        - node_modules
         - .gradle/wrapper
         - .gradle/caches
 <%_ } _%>
@@ -32,21 +31,14 @@ cache:
 cache:
     key: "$CI_COMMIT_REF_NAME"
     paths:
-        - node_modules
         - .maven
 <%_ } _%>
 stages:
     - build
-    - test
-    - package
-<%_ if (heroku.includes('gitlab')) { _%>
-    - deploy
-<%_ } _%>
 
 <%_ if (buildTool === 'gradle') { _%>
 before_script:
     - export GRADLE_USER_HOME=`pwd`/.gradle
-    - chmod +x gradlew
     <%_ if (!skipClient) { _%>
         <%_ if (clientPackageManager === 'yarn') { _%>
     - ./gradlew yarn_install -PnodeInstall --no-daemon
@@ -59,48 +51,28 @@ gradle-build:
     stage: build
     script:
         - ./gradlew compileJava -x check -PnodeInstall --no-daemon
-gradle-test:
-    stage: test
-    script:
         - ./gradlew test -PnodeInstall --no-daemon
-    artifacts:
-        paths:
-            - build/reports/tests/*
-# Uncomment following to expire the artifacts after defined period, https://docs.gitlab.com/ee/ci/yaml/README.html#artifacts-expire_in
-#       expire_in: 90 day
-    <%_ if (!skipClient) { _%>
-gradle-front-test:
-    stage: test
-    script:
         <%_ if (clientPackageManager === 'yarn') { _%>
         - ./gradlew yarn_test -PnodeInstall --no-daemon
         <%_ } else if (clientPackageManager === 'npm') { _%>
         - ./gradlew npm_test -PnodeInstall --no-daemon
         <%_ } _%>
-    artifacts:
-        paths:
-            - build/test-results/jest/*
-#       expire_in: 90 day
-    <%_ } _%>
-gradle-repackage:
-    stage: package
-    script:
+        <%_ if (cicdIntegrations.includes('sonar')) { _%>
+        - ./gradlew sonarqube --no-daemon <% if (sonarOrga) { %>-Dsonar.organization=<%= sonarOrga %> <% } %>-Dsonar.host.url=<%= sonarUrl %> -Dsonar.login=$SONAR_TOKEN
+        <%_ } _%>
         - ./gradlew bootWar -Pprod -x check -PnodeInstall --no-daemon
+        <%_ if (cicdIntegrations.includes('heroku')) { _%>
+        - ./gradlew deployHeroku --no-daemon
+        <%_ } _%>
     artifacts:
         paths:
             - build/libs/*.war
-#       expire_in: 90 day
-    <%_ if (heroku.includes('gitlab')) { _%>
-gradle-deploy:
-    stage: deploy
-    script:
-        - ./gradlew deployHeroku --no-daemon
-    <%_ } _%>
+        # Uncomment following to expire the artifacts after defined period, https://docs.gitlab.com/ee/ci/yaml/README.html#artifacts-expire_in
+        # expire_in: 90 day
 <%_ } _%>
 <%_ if (buildTool === 'maven') { _%>
 before_script:
     - export MAVEN_USER_HOME=`pwd`/.maven
-    - chmod +x mvnw
     <%_ if (!skipClient) { _%>
         <%_ if (clientPackageManager === 'yarn') { _%>
     - ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-yarn -DnodeVersion=v<%= NODE_VERSION %> -DyarnVersion=v<%= YARN_VERSION %> -Dmaven.repo.local=$MAVEN_USER_HOME
@@ -113,44 +85,22 @@ before_script:
 
 maven-build:
     stage: build
-    script: ./mvnw compile -Dmaven.repo.local=$MAVEN_USER_HOME
-
-maven-test:
-    stage: test
     script:
+        - ./mvnw compile -Dmaven.repo.local=$MAVEN_USER_HOME
         - ./mvnw test -Dmaven.repo.local=$MAVEN_USER_HOME
-    artifacts:
-        paths:
-            - target/surefire-reports/*
-# Uncomment following to expire the artifacts after defined period, https://docs.gitlab.com/ee/ci/yaml/README.html#artifacts-expire_in
-#       expire_in: 90 day
-    <%_ if (!skipClient) { _%>
-maven-front-test:
-    stage: test
-    script:
-        <%_ if (clientPackageManager === 'yarn') { _%>
-        - ./mvnw com.github.eirslett:frontend-maven-plugin:yarn -Dfrontend.yarn.arguments=test -Dmaven.repo.local=$MAVEN_USER_HOME
-        <%_ } else if (clientPackageManager === 'npm') { _%>
-        - ./mvnw com.github.eirslett:frontend-maven-plugin:npm -Dfrontend.yarn.arguments=test -Dmaven.repo.local=$MAVEN_USER_HOME
+        <%_ if (!skipClient) { _%>
+        - ./mvnw com.github.eirslett:frontend-maven-plugin:<%= clientPackageManager %> -Dfrontend.<%= clientPackageManager %>.arguments=test -Dmaven.repo.local=$MAVEN_USER_HOME
+        <%_ } _%>
+        <%_ if (cicdIntegrations.includes('sonar')) { _%>
+        - ./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar <% if (sonarOrga) { %>-Dsonar.organization=<%= sonarOrga %> <% } %>-Dsonar.host.url=<%= sonarUrl %> -Dsonar.login=$SONAR_TOKEN -Dmaven.repo.local=$MAVEN_USER_HOME
+        <%_ } _%>
+        - ./mvnw verify <% if (cicdIntegrations.includes('deploy')) { %>deploy <% } %>-Pprod -DskipTests -Dmaven.repo.local=$MAVEN_USER_HOME
+        <%_ if (cicdIntegrations.includes('heroku')) { _%>
+        - ./mvnw com.heroku.sdk:heroku-maven-plugin:2.0.5:deploy -DskipTests -Pprod -Dheroku.appName=<%= herokuAppName %> -Dmaven.repo.local=$MAVEN_USER_HOME
         <%_ } _%>
-    artifacts:
-        paths:
-            - target/test-results/jest/*
-#       expire_in: 90 day
-    <%_ } _%>
-    <%_ if (heroku.includes('gitlab')) { _%>
-maven-deploy:
-    stage: deploy
-    script:
-        - ./mvnw com.heroku.sdk:heroku-maven-plugin:1.1.1:deploy -DskipTests -Pprod -Dheroku.appName=<%= herokuAppName %> -Dmaven.repo.local=$MAVEN_USER_HOME
-    <%_ } else { _%>
-maven-package:
-    stage: package
-    script:
-        - ./mvnw verify -Pprod -DskipTests -Dmaven.repo.local=$MAVEN_USER_HOME
-    <%_ } _%>
     artifacts:
         paths:
             - target/*.war
-#       expire_in: 90 day
+        # Uncomment following to expire the artifacts after defined period, https://docs.gitlab.com/ee/ci/yaml/README.html#artifacts-expire_in
+        # expire_in: 90 day
 <%_ } _%>
diff --git a/generators/ci-cd/templates/circle.yml.ejs b/generators/ci-cd/templates/circle.yml.ejs
index 8824e117e3..e02275ba99 100644
--- a/generators/ci-cd/templates/circle.yml.ejs
+++ b/generators/ci-cd/templates/circle.yml.ejs
@@ -66,7 +66,7 @@ test:
     <%_ } _%>
 <%_ } _%>
 <%_ if (buildTool === 'maven') { _%>
-    <%_ if (heroku.includes('circle')) { _%>
+    <%_ if (cicdIntegrations.includes('circle')) { _%>
         - ./mvnw com.heroku.sdk:heroku-maven-plugin:2.0.5:deploy -DskipTests -Pprod -Dheroku.appName=<%= herokuAppName %>
     <%_ } else { _%>
         - ./mvnw verify -Pprod -DskipTests
diff --git a/generators/ci-cd/templates/jenkins/Jenkinsfile.ejs b/generators/ci-cd/templates/jenkins/Jenkinsfile.ejs
index bc4ed8fa3e..b59d3f3447 100644
--- a/generators/ci-cd/templates/jenkins/Jenkinsfile.ejs
+++ b/generators/ci-cd/templates/jenkins/Jenkinsfile.ejs
@@ -23,11 +23,11 @@ node {
         checkout scm
     }
 
-<%_ if (jenkinsIntegrations.includes('gitlab')) { _%>
+<%_ if (sendBuildToGitlab) { _%>
     gitlabCommitStatus('build') {
 <%_ } _%>
-<%_ if (jenkinsIntegrations.includes('docker')) { _%>
-<%= gitLabIndent %>    docker.image('openjdk:8').inside('-u root<% if (buildTool === 'maven') { %> -e MAVEN_OPTS="-Duser.home=./"<% } else if (buildTool === 'gradle') { %> -e GRADLE_USER_HOME=.gradle<% } %>') {
+<%_ if (insideDocker) { _%>
+<%= gitLabIndent %>    docker.image('jhipster/jhipster:v<%= jhipsterVersion %>').inside('-u root<% if (buildTool === 'maven') { %> -e MAVEN_OPTS="-Duser.home=./"<% } else if (buildTool === 'gradle') { %> -e GRADLE_USER_HOME=.gradle<% } %>') {
 <%_ } _%>
 <%= indent %>    stage('check java') {
 <%= indent %>        sh "java -version"
@@ -86,16 +86,15 @@ node {
 <%= indent %>    }
 
     <%_ } _%>
-    <%_ if (heroku.includes('jenkins')) { _%>
+    <%_ if (cicdIntegrations.includes('heroku')) { _%>
 <%= indent %>    stage('package and deploy') {
 <%= indent %>        sh "./mvnw com.heroku.sdk:heroku-maven-plugin:2.0.5:deploy -DskipTests -Pprod -Dheroku.appName=<%= herokuAppName %>"
     <%_ } else { _%>
 <%= indent %>    stage('packaging') {
-<%= indent %>        sh "./mvnw verify -Pprod -DskipTests"
+<%= indent %>        sh "./mvnw verify <% if (cicdIntegrations.includes('deploy')) { %>deploy <% } %>-Pprod -DskipTests"
     <%_ } _%>
 <%= indent %>        archiveArtifacts artifacts: '**/target/*.war', fingerprint: true
 <%= indent %>    }
-
 <%_ } else if (buildTool === 'gradle') { _%>
 <%= indent %>    stage('clean') {
 <%= indent %>        sh "chmod +x gradlew"
@@ -145,16 +144,16 @@ node {
 <%= indent %>        archiveArtifacts artifacts: '**/build/libs/*.war', fingerprint: true
 <%= indent %>    }
 
-    <%_ if (heroku.includes('jenkins')) { _%>
+    <%_ if (cicdIntegrations.includes('heroku')) { _%>
 <%= indent %>    stage('deployment') {
 <%= indent %>        sh "./gradlew deployHeroku --no-daemon"
 <%= indent %>    }
 
      <%_ } _%>
 <%_ } _%>
-<%_ if (jenkinsIntegrations.includes('sonar')) { _%>
+<%_ if (cicdIntegrations.includes('sonar')) { _%>
 <%= indent %>    stage('quality analysis') {
-<%= indent %>        withSonarQubeEnv('<%= jenkinsSonarName %>') {
+<%= indent %>        withSonarQubeEnv('<%= sonarName %>') {
     <%_ if (buildTool === 'maven') { _%>
 <%= indent %>            sh "./mvnw sonar:sonar"
     <%_ } else if (buildTool === 'gradle' ) { _%>
@@ -163,10 +162,10 @@ node {
 <%= indent %>        }
 <%= indent %>    }
 <%_ } _%>
-<%_ if (jenkinsIntegrations.includes('docker')) { _%>
+<%_ if (insideDocker) { _%>
 <%= gitLabIndent %>    }
 <%_ } _%>
-<%_ if (jenkinsIntegrations.includes('publishDocker')) { _%>
+<%_ if (cicdIntegrations.includes('publishDocker')) { _%>
 
 <%= gitLabIndent %>    def dockerImage
 <%= gitLabIndent %>    stage('build docker') {
@@ -187,7 +186,7 @@ node {
 <%= gitLabIndent %>        }
 <%= gitLabIndent %>    }
 <%_ } _%>
-<%_ if (jenkinsIntegrations.includes('gitlab')) { _%>
+<%_ if (sendBuildToGitlab) { _%>
     }
 <%_ } _%>
 }
diff --git a/generators/ci-cd/templates/travis.yml.ejs b/generators/ci-cd/templates/travis.yml.ejs
index bf0f5aa325..b51bd804b6 100644
--- a/generators/ci-cd/templates/travis.yml.ejs
+++ b/generators/ci-cd/templates/travis.yml.ejs
@@ -82,14 +82,19 @@ script:
     <%_ } _%>
 <%_ } _%>
 <%_ if (buildTool === 'maven') { _%>
-  <%_ if (heroku.includes('travis')) { _%>
-  - ./mvnw com.heroku.sdk:heroku-maven-plugin:2.0.5:deploy -DskipTests -Pprod -Dheroku.appName=<%= herokuAppName %>
-  <%_ } else { _%>
+  <%_ if (cicdIntegrations.includes('sonar')) { _%>
+  - ./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar <% if (sonarOrga) { %>-Dsonar.organization=<%= sonarOrga %> <% } %>-Dsonar.host.url=<%= sonarUrl %> -Dsonar.login=$SONAR_TOKEN
+  <%_ } _%>
   - ./mvnw verify -Pprod -DskipTests
+  <%_ if (cicdIntegrations.includes('heroku')) { _%>
+  - ./mvnw com.heroku.sdk:heroku-maven-plugin:2.0.5:deploy -DskipTests -Pprod -Dheroku.appName=<%= herokuAppName %>
   <%_ } _%>
 <%_ } else if (buildTool === 'gradle') { _%>
+  <%_ if (cicdIntegrations.includes('sonar')) { _%>
+  - ./gradlew sonarqube --no-daemon <% if (sonarOrga) { %>-Dsonar.organization=<%= sonarOrga %> <% } %>-Dsonar.host.url=<%= sonarUrl %> -Dsonar.login=$SONAR_TOKEN
+  <%_ } _%>
   - ./gradlew bootWar -Pprod -x test
-  <%_ if (heroku.includes('travis')) { _%>
+  <%_ if (cicdIntegrations.includes('heroku')) { _%>
   - ./gradlew deployHeroku
   <%_ } _%>
 <%_ } _%>
diff --git a/generators/generator-base.js b/generators/generator-base.js
index eb86708b0c..c1dea41107 100644
--- a/generators/generator-base.js
+++ b/generators/generator-base.js
@@ -1107,6 +1107,38 @@ module.exports = class extends PrivateBase {
         }
     }
 
+    /**
+     * Add a distributionManagement to the Maven build.
+     *
+     * @param {string} id - id of the repository
+     * @param {string} url - url of the repository
+     */
+    addMavenDistributionManagement(snapshotsId, snapshotsUrl, releasesId, releasesUrl) {
+        const fullPath = 'pom.xml';
+        try {
+            const repository = `${'<distributionManagement>\n'
+                + '        <snapshotRepository>\n'
+                + '            <id>'}${snapshotsId}</id>\n`
+                + `            <url>${snapshotsUrl}</url>\n`
+                + '        </snapshotRepository>\n'
+                + '        <repository>\n'
+                + `            <id>${releasesId}</id>\n`
+                + `            <url>${releasesUrl}</url>\n`
+                + '        </repository>\n'
+                + '    </distributionManagement>';
+            jhipsterUtils.rewriteFile({
+                file: fullPath,
+                needle: 'jhipster-needle-distribution-management',
+                splicable: [
+                    repository
+                ]
+            }, this);
+        } catch (e) {
+            this.log(`${chalk.yellow('\nUnable to find ') + fullPath + chalk.yellow(' or missing required jhipster-needle. Reference to ')}maven repository ${chalk.yellow(' not added.\n')}`);
+            this.debug('Error:', e);
+        }
+    }
+
     /**
      * Add a new Maven property.
      *
diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs
index 5d2ec79735..02a07dfd05 100644
--- a/generators/server/templates/pom.xml.ejs
+++ b/generators/server/templates/pom.xml.ejs
@@ -43,6 +43,8 @@
         <!-- jhipster-needle-maven-repository -->
     </repositories>
 
+    <!-- jhipster-needle-distribution-management -->
+    
     <properties>
         <!-- Build properties -->
         <maven.version>3.0.0</maven.version>
@@ -121,7 +123,9 @@
         <sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>squid:UndocumentedApi</sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>
         <sonar.jacoco.reportPaths>${project.testresult.directory}/coverage/jacoco/jacoco.exec</sonar.jacoco.reportPaths>
         <sonar.java.codeCoveragePlugin>jacoco</sonar.java.codeCoveragePlugin>
+        <%_ if (!skipClient) { _%>
         <sonar.testExecutionReportPaths>${project.testresult.directory}/jest/TESTS-results-sonar.xml</sonar.testExecutionReportPaths>
+        <%_ } _%>
         <sonar.typescript.lcov.reportPaths>${project.testresult.directory}/lcov.info</sonar.typescript.lcov.reportPaths>
         <sonar.sources>${project.basedir}/<%= MAIN_DIR %></sonar.sources>
         <sonar.surefire.reportsPath>${project.testresult.directory}/surefire-reports</sonar.surefire.reportsPath>


Test patch:
diff --git a/test/ci-cd.spec.js b/test/ci-cd.spec.js
index b714e744e0..709f587eef 100644
--- a/test/ci-cd.spec.js
+++ b/test/ci-cd.spec.js
@@ -1,6 +1,5 @@
 /* global describe, beforeEach, it */
 
-
 const path = require('path');
 const assert = require('yeoman-assert');
 const helpers = require('yeoman-test');
@@ -11,7 +10,9 @@ const expectedFiles = {
         '.travis.yml'
     ],
     jenkins: [
-        'Jenkinsfile'
+        'Jenkinsfile',
+        'src/main/docker/jenkins.yml',
+        'src/main/resources/idea.gdsl'
     ],
     gitlab: [
         '.gitlab-ci.yml'
@@ -25,275 +26,506 @@ const expectedFiles = {
 };
 
 describe('JHipster CI-CD Sub Generator', () => {
-    describe('Gradle Angular2 NPM', () => {
+    //--------------------------------------------------
+    // Jenkins tests
+    //--------------------------------------------------
+    describe('Jenkins: maven AngularX Yarn', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/gradle-ng2-npm'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-yarn'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'jenkins',
-                        'travis',
-                        'gitlab',
-                        'circle'
+                    pipeline: 'jenkins',
+                    insideDocker: false,
+                    cicdIntegrations: [
                     ]
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
-            assert.file(expectedFiles.travis);
             assert.file(expectedFiles.jenkins);
-            assert.file(expectedFiles.gitlab);
-            assert.file(expectedFiles.circle);
+        });
+        it('doesn\'t contain Docker, Sonar, Heroku', () => {
+            assert.noFileContent('Jenkinsfile', /docker/);
+            assert.noFileContent('Jenkinsfile', /sonar/);
+            assert.noFileContent('Jenkinsfile', /heroku/);
         });
     });
 
-    describe('Gradle Angular2 Yarn', () => {
+    describe('Jenkins: maven AngularX NPM', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/gradle-ng2-yarn'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-npm'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'jenkins',
-                        'travis',
-                        'gitlab',
-                        'circle'
+                    pipeline: 'jenkins',
+                    insideDocker: false,
+                    cicdIntegrations: [
                     ]
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
-            assert.file(expectedFiles.travis);
             assert.file(expectedFiles.jenkins);
-            assert.file(expectedFiles.gitlab);
-            assert.file(expectedFiles.circle);
+        });
+        it('doesn\'t contain Docker, Sonar, Heroku', () => {
+            assert.noFileContent('Jenkinsfile', /docker/);
+            assert.noFileContent('Jenkinsfile', /sonar/);
+            assert.noFileContent('Jenkinsfile', /heroku/);
         });
     });
 
-    describe('Maven Angular2 NPM', () => {
+    describe('Jenkins: Gradle AngularX Yarn', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ng2-npm'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/gradle-ngx-yarn'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'jenkins',
-                        'travis',
-                        'gitlab',
-                        'circle'
+                    pipeline: 'jenkins',
+                    insideDocker: false,
+                    cicdIntegrations: [
                     ]
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
-            assert.file(expectedFiles.travis);
             assert.file(expectedFiles.jenkins);
-            assert.file(expectedFiles.gitlab);
-            assert.file(expectedFiles.circle);
+        });
+        it('doesn\'t contain Docker, Sonar, Heroku', () => {
+            assert.noFileContent('Jenkinsfile', /docker/);
+            assert.noFileContent('Jenkinsfile', /sonar/);
+            assert.noFileContent('Jenkinsfile', /heroku/);
         });
     });
 
-    describe('Maven Angular2 Yarn', () => {
+    describe('Jenkins: Gradle AngularX NPM', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ng2-yarn'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/gradle-ngx-npm'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'jenkins',
-                        'travis',
-                        'gitlab',
-                        'circle'
+                    pipeline: 'jenkins',
+                    insideDocker: false,
+                    cicdIntegrations: [
                     ]
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
-            assert.file(expectedFiles.travis);
             assert.file(expectedFiles.jenkins);
-            assert.file(expectedFiles.gitlab);
-            assert.file(expectedFiles.circle);
         });
         it('doesn\'t contain Docker, Sonar, Heroku', () => {
             assert.noFileContent('Jenkinsfile', /docker/);
             assert.noFileContent('Jenkinsfile', /sonar/);
             assert.noFileContent('Jenkinsfile', /heroku/);
-            assert.noFileContent('.gitlab-ci.yml', /image: openjdk/);
-            assert.noFileContent('.gitlab-ci.yml', /heroku/);
-            assert.noFileContent('circle.yml', /heroku/);
-            assert.noFileContent('.travis.yml', /heroku/);
         });
     });
 
-    describe('Jenkins', () => {
+    describe('Jenkins: maven AngularX Yarn with full options', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ng2-yarn'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-yarn'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'jenkins'
-                    ],
-                    jenkinsIntegrations: [
-                        'docker',
+                    pipeline: 'jenkins',
+                    insideDocker: false,
+                    cicdIntegrations: [
+                        'deploy',
                         'sonar',
-                        'gitlab'
+                        'publishDocker',
+                        'heroku'
                     ],
-                    heroku: [
-                        'jenkins'
-                    ]
+                    artifactorySnapshotsId: 'snapshots',
+                    artifactorySnapshotsUrl: 'http://artifactory:8081/artifactory/libs-snapshot',
+                    artifactoryReleasesId: 'releases',
+                    artifactoryReleasesUrl: 'http://artifactory:8081/artifactory/libs-release',
+                    sonarName: 'sonarName',
+                    dockerRegistryURL: 'https://registry.hub.docker.com',
+                    dockerRegistryCredentialsId: 'docker-login',
+                    dockerRegistryOrganizationName: 'jhipster'
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
             assert.file(expectedFiles.jenkins);
-            assert.noFile(expectedFiles.gitlab);
-            assert.noFile(expectedFiles.travis);
-            assert.noFile(expectedFiles.circle);
         });
         it('contains Docker, Sonar, Heroku', () => {
-            assert.fileContent('Jenkinsfile', /docker/);
             assert.fileContent('Jenkinsfile', /sonar/);
             assert.fileContent('Jenkinsfile', /heroku/);
-            assert.noFileContent('Jenkinsfile', /def dockerImage/);
+            assert.fileContent('Jenkinsfile', /def dockerImage/);
+        });
+        it('contains distributionManagement in pom.xml', () => {
+            assert.fileContent('pom.xml', /distributionManagement/);
         });
     });
 
-    describe('Jenkins with pushing to Docker Registry', () => {
+    describe('Jenkins: maven AngularX Yarn inside Docker', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ng2-yarn'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-yarn'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'jenkins'
-                    ],
-                    jenkinsIntegrations: [
-                        'publishDocker'
+                    pipeline: 'jenkins',
+                    insideDocker: true,
+                    cicdIntegrations: [
+                        'deploy',
+                        'sonar',
+                        'publishDocker',
+                        'heroku'
                     ],
+                    artifactorySnapshotsId: 'snapshots',
+                    artifactorySnapshotsUrl: 'http://artifactory:8081/artifactory/libs-snapshot',
+                    artifactoryReleasesId: 'releases',
+                    artifactoryReleasesUrl: 'http://artifactory:8081/artifactory/libs-release',
+                    sonarName: 'sonarName',
                     dockerRegistryURL: 'https://registry.hub.docker.com',
-                    dockerRegistryCredentialsId: 'jhipster'
+                    dockerRegistryCredentialsId: 'docker-login',
+                    dockerRegistryOrganizationName: 'jhipster'
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
             assert.file(expectedFiles.jenkins);
-            assert.file(expectedFiles.dockerRegistry);
-            assert.noFile(expectedFiles.gitlab);
-            assert.noFile(expectedFiles.travis);
-            assert.noFile(expectedFiles.circle);
         });
-        it('contains def dockerImage', () => {
+        it('contains Docker, Sonar, Heroku, dockerImage', () => {
+            assert.fileContent('Jenkinsfile', /docker/);
+            assert.fileContent('Jenkinsfile', /sonar/);
+            assert.fileContent('Jenkinsfile', /heroku/);
             assert.fileContent('Jenkinsfile', /def dockerImage/);
         });
     });
 
-    describe('GitLab CI', () => {
+    //--------------------------------------------------
+    // GitLab CI tests
+    //--------------------------------------------------
+    describe('GitLab: maven AngularX Yarn', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ng2-yarn'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-yarn'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'gitlab'
-                    ],
-                    gitlabUseDocker: true,
-                    heroku: [
-                        'gitlab'
+                    pipeline: 'gitlab',
+                    insideDocker: false,
+                    cicdIntegrations: [
+                    ]
+                })
+                .on('end', done);
+        });
+        it('creates expected files', () => {
+            assert.file(expectedFiles.gitlab);
+        });
+        it('doesn\'t contain image: jhipster, Sonar, Heroku', () => {
+            assert.noFileContent('.gitlab-ci.yml', /image: jhipster/);
+            assert.noFileContent('.gitlab-ci.yml', /sonar/);
+            assert.noFileContent('.gitlab-ci.yml', /heroku/);
+        });
+    });
+
+    describe('GitLab: maven AngularX NPM', () => {
+        beforeEach((done) => {
+            helpers
+                .run(require.resolve('../generators/ci-cd'))
+                .inTmpDir((dir) => {
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-npm'), dir);
+                })
+                .withOptions({ skipChecks: true })
+                .withPrompts({
+                    pipeline: 'gitlab',
+                    insideDocker: false,
+                    cicdIntegrations: [
+                    ]
+                })
+                .on('end', done);
+        });
+        it('creates expected files', () => {
+            assert.file(expectedFiles.gitlab);
+        });
+        it('doesn\'t contain image: jhipster, Sonar, Heroku', () => {
+            assert.noFileContent('.gitlab-ci.yml', /image: jhipster/);
+            assert.noFileContent('.gitlab-ci.yml', /sonar/);
+            assert.noFileContent('.gitlab-ci.yml', /heroku/);
+        });
+    });
+
+    describe('GitLab: Gradle AngularX Yarn', () => {
+        beforeEach((done) => {
+            helpers
+                .run(require.resolve('../generators/ci-cd'))
+                .inTmpDir((dir) => {
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/gradle-ngx-yarn'), dir);
+                })
+                .withOptions({ skipChecks: true })
+                .withPrompts({
+                    pipeline: 'gitlab',
+                    cicdIntegrations: [
+                    ]
+                })
+                .on('end', done);
+        });
+        it('creates expected files', () => {
+            assert.file(expectedFiles.gitlab);
+        });
+        it('doesn\'t contain image: jhipster, Sonar, Heroku', () => {
+            assert.noFileContent('.gitlab-ci.yml', /image: jhipster/);
+            assert.noFileContent('.gitlab-ci.yml', /sonar/);
+            assert.noFileContent('.gitlab-ci.yml', /heroku/);
+        });
+    });
+
+    describe('GitLab: Gradle AngularX NPM', () => {
+        beforeEach((done) => {
+            helpers
+                .run(require.resolve('../generators/ci-cd'))
+                .inTmpDir((dir) => {
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/gradle-ngx-npm'), dir);
+                })
+                .withOptions({ skipChecks: true })
+                .withPrompts({
+                    pipeline: 'gitlab',
+                    cicdIntegrations: [
                     ]
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
             assert.file(expectedFiles.gitlab);
-            assert.noFile(expectedFiles.jenkins);
-            assert.noFile(expectedFiles.travis);
-            assert.noFile(expectedFiles.circle);
         });
-        it('contains image openjdk, heroku', () => {
-            assert.fileContent('.gitlab-ci.yml', /image: openjdk/);
+        it('doesn\'t contain jhipster/jhipster, Sonar, Heroku', () => {
+            assert.noFileContent('.gitlab-ci.yml', /image: jhipster/);
+            assert.noFileContent('.gitlab-ci.yml', /sonar/);
+            assert.noFileContent('.gitlab-ci.yml', /heroku/);
+        });
+    });
+
+    describe('GitLab: maven AngularX Yarn with full options', () => {
+        beforeEach((done) => {
+            helpers
+                .run(require.resolve('../generators/ci-cd'))
+                .inTmpDir((dir) => {
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-yarn'), dir);
+                })
+                .withOptions({ skipChecks: true })
+                .withPrompts({
+                    pipeline: 'gitlab',
+                    insideDocker: false,
+                    cicdIntegrations: [
+                        'deploy',
+                        'sonar',
+                        'heroku'
+                    ],
+                    artifactorySnapshotsId: 'snapshots',
+                    artifactorySnapshotsUrl: 'http://artifactory:8081/artifactory/libs-snapshot',
+                    artifactoryReleasesId: 'releases',
+                    artifactoryReleasesUrl: 'http://artifactory:8081/artifactory/libs-release',
+                    sonarUrl: 'http://localhost:9000'
+                })
+                .on('end', done);
+        });
+        it('creates expected files', () => {
+            assert.file(expectedFiles.gitlab);
+        });
+        it('contains Sonar, Heroku', () => {
+            assert.noFileContent('.gitlab-ci.yml', /image: jhipster/);
+            assert.fileContent('.gitlab-ci.yml', /sonar/);
             assert.fileContent('.gitlab-ci.yml', /heroku/);
         });
+        it('contains distributionManagement in pom.xml', () => {
+            assert.fileContent('pom.xml', /distributionManagement/);
+        });
     });
 
-    describe('Circle CI', () => {
+    describe('GitLab: maven AngularX Yarn inside Docker', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ng2-yarn'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-yarn'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'circle'
+                    pipeline: 'gitlab',
+                    insideDocker: true,
+                    cicdIntegrations: [
+                        'deploy',
+                        'sonar',
+                        'heroku'
                     ],
-                    gitlabUseDocker: true,
-                    heroku: [
-                        'circle'
+                    artifactorySnapshotsId: 'snapshots',
+                    artifactorySnapshotsUrl: 'http://artifactory:8081/artifactory/libs-snapshot',
+                    artifactoryReleasesId: 'releases',
+                    artifactoryReleasesUrl: 'http://artifactory:8081/artifactory/libs-release',
+                    sonarUrl: 'http://localhost:9000',
+                    dockerRegistryURL: 'https://registry.hub.docker.com',
+                    dockerRegistryCredentialsId: 'docker-login',
+                    dockerRegistryOrganizationName: 'jhipster'
+                })
+                .on('end', done);
+        });
+        it('creates expected files', () => {
+            assert.file(expectedFiles.gitlab);
+        });
+        it('contains image: jhipster, Sonar, Heroku', () => {
+            assert.fileContent('.gitlab-ci.yml', /image: jhipster/);
+            assert.fileContent('.gitlab-ci.yml', /sonar/);
+            assert.fileContent('.gitlab-ci.yml', /heroku/);
+        });
+        it('contains distributionManagement in pom.xml', () => {
+            assert.fileContent('pom.xml', /distributionManagement/);
+        });
+    });
+
+    //--------------------------------------------------
+    // Travis CI tests
+    //--------------------------------------------------
+    describe('Travis CI: maven AngularX Yarn', () => {
+        beforeEach((done) => {
+            helpers
+                .run(require.resolve('../generators/ci-cd'))
+                .inTmpDir((dir) => {
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-yarn'), dir);
+                })
+                .withOptions({ skipChecks: true })
+                .withPrompts({
+                    pipeline: 'travis',
+                    cicdIntegrations: [
                     ]
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
-            assert.file(expectedFiles.circle);
-            assert.noFile(expectedFiles.jenkins);
-            assert.noFile(expectedFiles.travis);
-            assert.noFile(expectedFiles.gitlab);
+            assert.file(expectedFiles.travis);
         });
-        it('contains heroku', () => {
-            assert.fileContent('circle.yml', /heroku/);
+        it('doesn\'t contain Sonar, Heroku', () => {
+            assert.noFileContent('.travis.yml', /sonar/);
+            assert.noFileContent('.travis.yml', /heroku/);
         });
     });
 
-    describe('Travis CI', () => {
+    describe('Travis CI: maven AngularX NPM', () => {
         beforeEach((done) => {
             helpers
                 .run(require.resolve('../generators/ci-cd'))
                 .inTmpDir((dir) => {
-                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ng2-yarn'), dir);
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-npm'), dir);
                 })
                 .withOptions({ skipChecks: true })
                 .withPrompts({
-                    pipelines: [
-                        'travis'
-                    ],
-                    heroku: [
-                        'travis'
+                    pipeline: 'travis',
+                    cicdIntegrations: [
                     ]
                 })
                 .on('end', done);
         });
         it('creates expected files', () => {
             assert.file(expectedFiles.travis);
-            assert.noFile(expectedFiles.jenkins);
-            assert.noFile(expectedFiles.circle);
-            assert.noFile(expectedFiles.gitlab);
         });
-        it('contains heroku', () => {
+        it('doesn\'t contain Sonar, Heroku', () => {
+            assert.noFileContent('.travis.yml', /sonar/);
+            assert.noFileContent('.travis.yml', /heroku/);
+        });
+    });
+
+    describe('Travis CI: Gradle AngularX Yarn', () => {
+        beforeEach((done) => {
+            helpers
+                .run(require.resolve('../generators/ci-cd'))
+                .inTmpDir((dir) => {
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/gradle-ngx-yarn'), dir);
+                })
+                .withOptions({ skipChecks: true })
+                .withPrompts({
+                    pipeline: 'travis',
+                    cicdIntegrations: [
+                    ]
+                })
+                .on('end', done);
+        });
+        it('creates expected files', () => {
+            assert.file(expectedFiles.travis);
+        });
+        it('doesn\'t contain Sonar, Heroku', () => {
+            assert.noFileContent('.travis.yml', /sonar/);
+            assert.noFileContent('.travis.yml', /heroku/);
+        });
+    });
+
+    describe('Travis CI: Gradle AngularX NPM', () => {
+        beforeEach((done) => {
+            helpers
+                .run(require.resolve('../generators/ci-cd'))
+                .inTmpDir((dir) => {
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/gradle-ngx-npm'), dir);
+                })
+                .withOptions({ skipChecks: true })
+                .withPrompts({
+                    pipeline: 'travis',
+                    cicdIntegrations: [
+                    ]
+                })
+                .on('end', done);
+        });
+        it('creates expected files', () => {
+            assert.file(expectedFiles.travis);
+        });
+        it('doesn\'t contain Sonar, Heroku', () => {
+            assert.noFileContent('.travis.yml', /sonar/);
+            assert.noFileContent('.travis.yml', /heroku/);
+        });
+    });
+
+    describe('Travis CI: maven AngularX Yarn with full options', () => {
+        beforeEach((done) => {
+            helpers
+                .run(require.resolve('../generators/ci-cd'))
+                .inTmpDir((dir) => {
+                    fse.copySync(path.join(__dirname, './templates/ci-cd/maven-ngx-yarn'), dir);
+                })
+                .withOptions({ skipChecks: true })
+                .withPrompts({
+                    pipeline: 'travis',
+                    cicdIntegrations: [
+                        'deploy',
+                        'sonar',
+                        'heroku'
+                    ],
+                    artifactorySnapshotsId: 'snapshots',
+                    artifactorySnapshotsUrl: 'http://artifactory:8081/artifactory/libs-snapshot',
+                    artifactoryReleasesId: 'releases',
+                    artifactoryReleasesUrl: 'http://artifactory:8081/artifactory/libs-release',
+                    sonarUrl: 'http://localhost:9000'
+                })
+                .on('end', done);
+        });
+        it('creates expected files', () => {
+            assert.file(expectedFiles.travis);
+        });
+        it('contains Sonar, Heroku', () => {
+            assert.fileContent('.travis.yml', /sonar/);
             assert.fileContent('.travis.yml', /heroku/);
         });
+        it('contains distributionManagement in pom.xml', () => {
+            assert.fileContent('pom.xml', /distributionManagement/);
+        });
     });
 });
diff --git a/test/templates/ci-cd/gradle-ng2-npm/.yo-rc.json b/test/templates/ci-cd/gradle-ngx-npm/.yo-rc.json
similarity index 94%
rename from test/templates/ci-cd/gradle-ng2-npm/.yo-rc.json
rename to test/templates/ci-cd/gradle-ngx-npm/.yo-rc.json
index 372ad87fdf..77005fa6b4 100644
--- a/test/templates/ci-cd/gradle-ng2-npm/.yo-rc.json
+++ b/test/templates/ci-cd/gradle-ngx-npm/.yo-rc.json
@@ -20,6 +20,9 @@
     "clientPackageManager": "npm",
     "testFrameworks": [
       "gatling"
+    ],
+    "languages": [
+      "en"
     ]
   }
 }
diff --git a/test/templates/ci-cd/gradle-ng2-yarn/.yo-rc.json b/test/templates/ci-cd/gradle-ngx-yarn/.yo-rc.json
similarity index 94%
rename from test/templates/ci-cd/gradle-ng2-yarn/.yo-rc.json
rename to test/templates/ci-cd/gradle-ngx-yarn/.yo-rc.json
index 073e7792dd..a70e004e19 100644
--- a/test/templates/ci-cd/gradle-ng2-yarn/.yo-rc.json
+++ b/test/templates/ci-cd/gradle-ngx-yarn/.yo-rc.json
@@ -20,6 +20,9 @@
     "clientPackageManager": "yarn",
     "testFrameworks": [
       "gatling"
+    ],
+    "languages": [
+      "en"
     ]
   }
 }
diff --git a/test/templates/ci-cd/maven-ng2-npm/.yo-rc.json b/test/templates/ci-cd/maven-ngx-npm/.yo-rc.json
similarity index 94%
rename from test/templates/ci-cd/maven-ng2-npm/.yo-rc.json
rename to test/templates/ci-cd/maven-ngx-npm/.yo-rc.json
index 287f75bc37..b5c81e18a4 100644
--- a/test/templates/ci-cd/maven-ng2-npm/.yo-rc.json
+++ b/test/templates/ci-cd/maven-ngx-npm/.yo-rc.json
@@ -20,6 +20,9 @@
     "clientPackageManager": "npm",
     "testFrameworks": [
       "gatling"
+    ],
+    "languages": [
+      "en"
     ]
   }
 }
diff --git a/test/templates/ci-cd/maven-ng2-yarn/.yo-rc.json b/test/templates/ci-cd/maven-ngx-yarn/.yo-rc.json
similarity index 94%
rename from test/templates/ci-cd/maven-ng2-yarn/.yo-rc.json
rename to test/templates/ci-cd/maven-ngx-yarn/.yo-rc.json
index 22e1d638f1..3ff6dc618f 100644
--- a/test/templates/ci-cd/maven-ng2-yarn/.yo-rc.json
+++ b/test/templates/ci-cd/maven-ngx-yarn/.yo-rc.json
@@ -20,6 +20,9 @@
     "clientPackageManager": "yarn",
     "testFrameworks": [
       "gatling"
+    ],
+    "languages": [
+      "en"
     ]
   }
 }
diff --git a/test/templates/ci-cd/maven-ngx-yarn/pom.xml b/test/templates/ci-cd/maven-ngx-yarn/pom.xml
new file mode 100644
index 0000000000..5034e0b8bf
--- /dev/null
+++ b/test/templates/ci-cd/maven-ngx-yarn/pom.xml
@@ -0,0 +1,1030 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.mycompany.myapp</groupId>
+    <artifactId>sample-mysql</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>war</packaging>
+    <name>Sample Mysql</name>
+
+    <repositories>
+        <!-- TODO Remove snapshot repositories after final Spring Boot 2 release -->
+        <repository>
+            <id>spring-milestones</id>
+            <name>Spring Milestones</name>
+            <url>http://repo.spring.io/milestone</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <!-- jhipster-needle-maven-repository -->
+    </repositories>
+    <pluginRepositories>
+        <pluginRepository>
+            <id>spring-milestones</id>
+            <name>Spring Milestones</name>
+            <url>http://repo.spring.io/milestone</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+    <!-- jhipster-needle-distribution-management -->
+    
+    <properties>
+        <!-- Build properties -->
+        <maven.version>3.0.0</maven.version>
+        <java.version>1.8</java.version>
+        <scala.version>2.12.1</scala.version>
+        <node.version>v8.11.2</node.version>
+        <yarn.version>v1.6.0</yarn.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
+        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
+        <maven.compiler.source>${java.version}</maven.compiler.source>
+        <maven.compiler.target>${java.version}</maven.compiler.target>
+        <argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
+        <m2e.apt.activation>jdt_apt</m2e.apt.activation>
+        <run.addResources>false</run.addResources>
+        <!-- These remain empty unless the corresponding profile is active -->
+        <profile.no-liquibase />
+        <profile.swagger />
+
+        <!-- Dependency versions -->
+        <jhipster-dependencies.version>2.0.8</jhipster-dependencies.version>
+        <!-- The spring-boot version should match the one managed by
+        https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster-dependencies.version} -->
+        <spring-boot.version>2.0.2.RELEASE</spring-boot.version>
+        <!-- The hibernate version should match the one managed by
+        https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
+        <hibernate.version>5.2.17.Final</hibernate.version>
+        <!-- The javassist version should match the one managed by
+        https://mvnrepository.com/artifact/org.hibernate/hibernate-core/${hibernate.version} -->
+        <javassist.version>3.22.0-GA</javassist.version>
+        <!-- The liquibase version should match the one managed by
+        https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
+        <liquibase.version>3.5.5</liquibase.version>
+        <liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>
+        <validation-api.version>2.0.1.Final</validation-api.version>
+        <mapstruct.version>1.2.0.Final</mapstruct.version>
+
+        <!-- Plugin versions -->
+        <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
+        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
+        <maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
+        <maven-enforcer-plugin.version>3.0.0-M1</maven-enforcer-plugin.version>
+        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
+        <maven-surefire-plugin.version>2.21.0</maven-surefire-plugin.version>
+        <maven-war-plugin.version>3.2.0</maven-war-plugin.version>
+        <dockerfile-maven-plugin.version>1.4.0</dockerfile-maven-plugin.version>
+        <frontend-maven-plugin.version>1.6</frontend-maven-plugin.version>
+        <jacoco-maven-plugin.version>0.8.1</jacoco-maven-plugin.version>
+        <scala-maven-plugin.version>3.3.2</scala-maven-plugin.version>
+        <sonar-maven-plugin.version>3.4.0.905</sonar-maven-plugin.version>
+
+        <!-- Sonar properties -->
+        <sonar.exclusions>src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/www/**/*.*</sonar.exclusions>
+        <sonar.issue.ignore.multicriteria>S3437,UndocumentedApi,BoldAndItalicTagsCheck</sonar.issue.ignore.multicriteria>
+        <!-- Rule https://sonarcloud.io/coding_rules?open=Web%3ABoldAndItalicTagsCheck&rule_key=Web%3ABoldAndItalicTagsCheck is ignored. Even if we agree that using the "i" tag is an awful practice, this is what is recommended by http://fontawesome.io/examples/ -->
+        <sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.resourceKey>src/main/webapp/app/**/*.*</sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.resourceKey>
+        <sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.ruleKey>Web:BoldAndItalicTagsCheck</sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.ruleKey>
+        <!-- Rule https://sonarcloud.io/coding_rules?open=squid%3AS3437&rule_key=squid%3AS3437 is ignored, as a JPA-managed field cannot be transient -->
+        <sonar.issue.ignore.multicriteria.S3437.resourceKey>src/main/java/**/*</sonar.issue.ignore.multicriteria.S3437.resourceKey>
+        <sonar.issue.ignore.multicriteria.S3437.ruleKey>squid:S3437</sonar.issue.ignore.multicriteria.S3437.ruleKey>
+        <!-- Rule https://sonarcloud.io/coding_rules?open=squid%3AUndocumentedApi&rule_key=squid%3AUndocumentedApi is ignored, as we want to follow "clean code" guidelines and classes, methods and arguments names should be self-explanatory -->
+        <sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey>src/main/java/**/*</sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey>
+        <sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>squid:UndocumentedApi</sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>
+        <sonar.jacoco.reportPaths>${project.testresult.directory}/coverage/jacoco/jacoco.exec</sonar.jacoco.reportPaths>
+        <sonar.java.codeCoveragePlugin>jacoco</sonar.java.codeCoveragePlugin>
+        <sonar.javascript.jstestdriver.reportsPath>${project.testresult.directory}/karma</sonar.javascript.jstestdriver.reportsPath>
+        <sonar.typescript.lcov.reportPaths>${project.testresult.directory}/lcov.info</sonar.typescript.lcov.reportPaths>
+        <sonar.sources>${project.basedir}/src/main/</sonar.sources>
+        <sonar.surefire.reportsPath>${project.testresult.directory}/surefire-reports</sonar.surefire.reportsPath>
+        <sonar.tests>${project.basedir}/src/test/</sonar.tests>
+
+        <!-- jhipster-needle-maven-property -->
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>io.github.jhipster</groupId>
+                <artifactId>jhipster-dependencies</artifactId>
+                <version>${jhipster-dependencies.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <!-- jhipster-needle-maven-add-dependency-management -->
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>io.github.jhipster</groupId>
+            <artifactId>jhipster-framework</artifactId>
+        </dependency>
+
+        <!-- TODO To remove after final Spring Boot 2 release -->
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-cache</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-annotation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-json</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-jcache</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-jvm</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-servlet</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-servlets</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.datatype</groupId>
+            <artifactId>jackson-datatype-hibernate5</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.datatype</groupId>
+            <artifactId>jackson-datatype-hppc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.datatype</groupId>
+            <artifactId>jackson-datatype-jsr310</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.datatype</groupId>
+            <artifactId>jackson-datatype-json-org</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.module</groupId>
+            <artifactId>jackson-module-afterburner</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.jayway.jsonpath</groupId>
+            <artifactId>json-path</artifactId>
+            <scope>test</scope>
+            <!-- parent POM declares this dependency in default (compile) scope -->
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-bean-validators</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.mattbertolini</groupId>
+            <artifactId>liquibase-slf4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.ryantenney.metrics</groupId>
+            <artifactId>metrics-spring</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.zaxxer</groupId>
+            <artifactId>HikariCP</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.cache</groupId>
+            <artifactId>cache-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ehcache</groupId>
+            <artifactId>ehcache</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-jcache</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-jpamodelgen</artifactId>
+            <version>${hibernate.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-envers</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate.validator</groupId>
+            <artifactId>hibernate-validator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.liquibase</groupId>
+            <artifactId>liquibase-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>net.logstash.logback</groupId>
+            <artifactId>logstash-logback-encoder</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mapstruct</groupId>
+            <artifactId>mapstruct-jdk8</artifactId>
+            <version>${mapstruct.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mapstruct</groupId>
+            <artifactId>mapstruct-processor</artifactId>
+            <version>${mapstruct.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-loader-tools</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.micrometer</groupId>
+                    <artifactId>micrometer-core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.zalando</groupId>
+            <artifactId>problem-spring-web</artifactId>
+        </dependency>
+        <!-- Spring Cloud -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-spring-service-connector</artifactId>
+        </dependency>
+        <!-- Security -->
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-data</artifactId>
+        </dependency>
+        <!-- jhipster-needle-maven-add-dependency -->
+    </dependencies>
+
+    <build>
+        <defaultGoal>spring-boot:run</defaultGoal>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${maven-compiler-plugin.version}</version>
+                <configuration>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>org.mapstruct</groupId>
+                            <artifactId>mapstruct-processor</artifactId>
+                            <version>${mapstruct.version}</version>
+                        </path>
+                        <!-- For JPA static metamodel generation -->
+                        <path>
+                            <groupId>org.hibernate</groupId>
+                            <artifactId>hibernate-jpamodelgen</artifactId>
+                            <version>${hibernate.version}</version>
+                        </path>
+
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <version>${maven-eclipse-plugin.version}</version>
+                <configuration>
+                    <downloadSources>true</downloadSources>
+                    <downloadJavadocs>true</downloadJavadocs>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <version>${maven-enforcer-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>enforce-versions</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <rules>
+                        <requireMavenVersion>
+                            <message>You are running an older version of Maven. JHipster requires at least Maven ${maven.version}</message>
+                            <version>[${maven.version},)</version>
+                        </requireMavenVersion>
+                        <requireJavaVersion>
+                            <!-- Until JHipster supports JDK 9 -->
+                            <message>You are running an incompatible version of Java. JHipster requires JDK ${java.version}</message>
+                            <version>[1.8,1.9)</version>
+                        </requireJavaVersion>
+                    </rules>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>${maven-resources-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>default-resources</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>target/classes</outputDirectory>
+                            <useDefaultDelimiters>false</useDefaultDelimiters>
+                            <delimiters>
+                                <delimiter>#</delimiter>
+                            </delimiters>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/</directory>
+                                    <filtering>true</filtering>
+                                    <includes>
+                                        <include>config/*.yml</include>
+                                    </includes>
+                                </resource>
+                                <resource>
+                                    <directory>src/main/resources/</directory>
+                                    <filtering>false</filtering>
+                                    <excludes>
+                                        <exclude>config/*.yml</exclude>
+                                    </excludes>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>docker-resources</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>target/</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/docker/</directory>
+                                    <filtering>false</filtering>
+                                    <excludes>
+                                        <exclude>**/*.yml</exclude>
+                                    </excludes>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>${maven-surefire-plugin.version}</version>
+                <configuration>
+                    <!-- Force alphabetical order to have a reproducible build -->
+                    <runOrder>alphabetical</runOrder>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>${jacoco-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>pre-unit-tests</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                        <configuration>
+                            <!-- Sets the path to the file which contains the execution data. -->
+                            <destFile>${project.testresult.directory}/coverage/jacoco/jacoco.exec</destFile>
+                        </configuration>
+                    </execution>
+                    <!-- Ensures that the code coverage report for unit tests is created after unit tests have been run -->
+                    <execution>
+                        <id>post-unit-test</id>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>report</goal>
+                        </goals>
+                        <configuration>
+                            <dataFile>${project.testresult.directory}/coverage/jacoco/jacoco.exec</dataFile>
+                            <outputDirectory>${project.testresult.directory}/coverage/jacoco</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.sonarsource.scanner.maven</groupId>
+                <artifactId>sonar-maven-plugin</artifactId>
+                <version>${sonar-maven-plugin.version}</version>
+            </plugin>
+            <plugin>
+                <groupId>org.liquibase</groupId>
+                <artifactId>liquibase-maven-plugin</artifactId>
+                <version>${liquibase.version}</version>
+                <configuration>
+                    <changeLogFile>src/main/resources/config/liquibase/master.xml</changeLogFile>
+                    <diffChangeLogFile>src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
+                    <driver>org.h2.Driver</driver>
+                    <url>jdbc:h2:file:./target/h2db/db/samplemysql</url>
+                    <defaultSchemaName></defaultSchemaName>
+                    <username>sampleMysql</username>
+                    <password></password>
+                    <referenceUrl>hibernate:spring:com.mycompany.myapp.domain?dialect=org.hibernate.dialect.H2Dialect&amp;hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&amp;hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl>
+                    <verbose>true</verbose>
+                    <logging>debug</logging>
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.javassist</groupId>
+                        <artifactId>javassist</artifactId>
+                        <version>${javassist.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.liquibase.ext</groupId>
+                        <artifactId>liquibase-hibernate5</artifactId>
+                        <version>${liquibase-hibernate5.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.springframework.boot</groupId>
+                        <artifactId>spring-boot-starter-data-jpa</artifactId>
+                        <version>${spring-boot.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>javax.validation</groupId>
+                        <artifactId>validation-api</artifactId>
+                        <version>${validation-api.version}</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring-boot.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <mainClass>${start-class}</mainClass>
+                    <executable>true</executable>
+                    <fork>true</fork>
+                    <!--
+                    Enable the line below to have remote debugging of your application on port 5005
+                    <jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
+                    -->
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>dockerfile-maven-plugin</artifactId>
+                <version>${dockerfile-maven-plugin.version}</version>
+                <!--
+                Uncomment the section below to build the docker image with mvn package and and push it with mvn deploy
+                <executions>
+                    <execution>
+                    <id>default</id>
+                    <goals>
+                        <goal>build</goal>
+                        <goal>push</goal>
+                    </goals>
+                    </execution>
+                </executions>
+                -->
+                <configuration>
+                    <repository>samplemysql</repository>
+                    <tag>latest</tag>
+                    <contextDirectory>${project.build.directory}</contextDirectory>
+                </configuration>
+            </plugin>
+            <!-- jhipster-needle-maven-add-plugin -->
+        </plugins>
+        <pluginManagement>
+            <plugins>
+                <!--
+                    This plugin's configuration is used to store Eclipse m2e settings only.
+                    It has no influence on the Maven build itself.
+                    Remove when the m2e plugin can correctly bind to Maven lifecycle
+                -->
+                <plugin>
+                    <groupId>org.eclipse.m2e</groupId>
+                    <artifactId>lifecycle-mapping</artifactId>
+                    <version>1.0.0</version>
+                    <configuration>
+                        <lifecycleMappingMetadata>
+                            <pluginExecutions>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>org.jacoco</groupId>
+                                        <artifactId>
+                                            jacoco-maven-plugin
+                                        </artifactId>
+                                        <versionRange>
+                                            ${jacoco-maven-plugin.version}
+                                        </versionRange>
+                                        <goals>
+                                            <goal>prepare-agent</goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <ignore/>
+                                    </action>
+                                </pluginExecution>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>com.github.eirslett</groupId>
+                                        <artifactId>frontend-maven-plugin</artifactId>
+                                        <versionRange>${frontend-maven-plugin.version}</versionRange>
+                                        <goals>
+                                            <goal>install-node-and-yarn</goal>
+                                            <goal>yarn</goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <ignore/>
+                                    </action>
+                                </pluginExecution>
+                            </pluginExecutions>
+                        </lifecycleMappingMetadata>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+    <profiles>
+        <profile>
+            <id>no-liquibase</id>
+            <properties>
+                <profile.no-liquibase>,no-liquibase</profile.no-liquibase>
+            </properties>
+        </profile>
+        <profile>
+            <id>swagger</id>
+            <properties>
+                <profile.swagger>,swagger</profile.swagger>
+            </properties>
+        </profile>
+        <profile>
+            <id>webpack</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.github.eirslett</groupId>
+                        <artifactId>frontend-maven-plugin</artifactId>
+                        <version>${frontend-maven-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <id>install node and yarn</id>
+                                <goals>
+                                    <goal>install-node-and-yarn</goal>
+                                </goals>
+                                <configuration>
+                                    <nodeVersion>${node.version}</nodeVersion>
+                                    <yarnVersion>${yarn.version}</yarnVersion>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>webpack build dev</id>
+                                <goals>
+                                    <goal>yarn</goal>
+                                </goals>
+                                <phase>generate-resources</phase>
+                                <configuration>
+                                    <arguments>run webpack:build</arguments>
+                                    <yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>dev</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-undertow</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-devtools</artifactId>
+                    <optional>true</optional>
+                </dependency>
+                <dependency>
+                    <groupId>com.h2database</groupId>
+                    <artifactId>h2</artifactId>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <version>${maven-war-plugin.version}</version>
+                        <configuration>
+                            <failOnMissingWebXml>false</failOnMissingWebXml>
+                            <warSourceDirectory>target/www/</warSourceDirectory>
+                            <webResources>
+                                <resource>
+                                    <directory>src/main/webapp</directory>
+                                    <includes>
+                                        <include>WEB-INF/**</include>
+                                    </includes>
+                                </resource>
+                            </webResources>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+            <properties>
+                <!-- default Spring profiles -->
+                <spring.profiles.active>dev${profile.no-liquibase}</spring.profiles.active>
+            </properties>
+        </profile>
+        <profile>
+            <id>prod</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-undertow</artifactId>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-clean-plugin</artifactId>
+                        <version>${maven-clean-plugin.version}</version>
+                        <configuration>
+                            <filesets>
+                                <fileset>
+                                    <directory>target/www/</directory>
+                                </fileset>
+                            </filesets>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <version>${maven-war-plugin.version}</version>
+                        <configuration>
+                            <failOnMissingWebXml>false</failOnMissingWebXml>
+                            <warSourceDirectory>target/www/</warSourceDirectory>
+                            <webResources>
+                                <resource>
+                                    <directory>src/main/webapp</directory>
+                                    <includes>
+                                        <include>WEB-INF/**</include>
+                                    </includes>
+                                </resource>
+                            </webResources>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.springframework.boot</groupId>
+                        <artifactId>spring-boot-maven-plugin</artifactId>
+                        <version>${spring-boot.version}</version>
+                        <configuration>
+                            <mainClass>${start-class}</mainClass>
+                            <executable>true</executable>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>build-info</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>com.github.eirslett</groupId>
+                        <artifactId>frontend-maven-plugin</artifactId>
+                        <version>${frontend-maven-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <id>install node and yarn</id>
+                                <goals>
+                                    <goal>install-node-and-yarn</goal>
+                                </goals>
+                                <configuration>
+                                    <nodeVersion>${node.version}</nodeVersion>
+                                    <yarnVersion>${yarn.version}</yarnVersion>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>yarn install</id>
+                                <goals>
+                                    <goal>yarn</goal>
+                                </goals>
+                                <configuration>
+                                    <arguments>install</arguments>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>webpack build test</id>
+                                <goals>
+                                    <goal>yarn</goal>
+                                </goals>
+                                <phase>test</phase>
+                                <configuration>
+                                    <arguments>run webpack:test</arguments>
+                                    <yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>webpack build prod</id>
+                                <goals>
+                                    <goal>yarn</goal>
+                                </goals>
+                                <phase>generate-resources</phase>
+                                <configuration>
+                                    <arguments>run webpack:prod</arguments>
+                                    <yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>pl.project13.maven</groupId>
+                        <artifactId>git-commit-id-plugin</artifactId>
+                        <version>2.2.4</version>
+                            <executions>
+                                <execution>
+                                    <goals>
+                                        <goal>revision</goal>
+                                    </goals>
+                                </execution>
+                            </executions>
+                            <configuration>
+                                <failOnNoGitDirectory>false</failOnNoGitDirectory>
+                                <generateGitPropertiesFile>true</generateGitPropertiesFile>
+                                <includeOnlyProperties>
+                                    <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
+                                    <includeOnlyProperty>^git.commit.id.describe$</includeOnlyProperty>
+                                    <includeOnlyProperty>^git.branch$</includeOnlyProperty>
+                                </includeOnlyProperties>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+            <properties>
+                <!-- default Spring profiles -->
+                <spring.profiles.active>prod${profile.swagger}${profile.no-liquibase}</spring.profiles.active>
+            </properties>
+        </profile>
+        <profile>
+            <!--
+                Profile for doing "continuous compilation" with the Scala Maven plugin.
+                It allows automatic compilation of Java classes as soon as they are saved.
+                To use it, run in 3 terminals:
+                - './mvnw -Pcc scala:cc' for continuous compilation of your classes
+                - './mvnw -Pcc -Pdev' for hot reload of Spring boot
+                - 'npm start/yarn start' for hot reload of the HTML/JavaScript asset
+                Everything should hot reload automatically!
+            -->
+            <id>cc</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-undertow</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-devtools</artifactId>
+                    <optional>true</optional>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <version>${maven-war-plugin.version}</version>
+                        <configuration>
+                            <failOnMissingWebXml>false</failOnMissingWebXml>
+                            <warSourceDirectory>src/main/webapp/</warSourceDirectory>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.springframework.boot</groupId>
+                        <artifactId>spring-boot-maven-plugin</artifactId>
+                        <version>${spring-boot.version}</version>
+                        <configuration>
+                            <mainClass>${start-class}</mainClass>
+                            <executable>true</executable>
+                            <fork>true</fork>
+                            <addResources>true</addResources>
+                            <!--
+                            Enable the line below to have remote debugging of your application on port 5005
+                            <jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
+                            -->
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-compiler-plugin</artifactId>
+                        <version>${maven-compiler-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <id>default-compile</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>default-testCompile</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>net.alchim31.maven</groupId>
+                        <artifactId>scala-maven-plugin</artifactId>
+                        <version>${scala-maven-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <id>compile</id>
+                                <phase>compile</phase>
+                                <goals>
+                                    <goal>add-source</goal>
+                                    <goal>compile</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>test-compile</id>
+                                <phase>test-compile</phase>
+                                <goals>
+                                    <goal>add-source</goal>
+                                    <goal>testCompile</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <recompileMode>incremental</recompileMode>
+                            <verbose>true</verbose>
+                            <scalaVersion>${scala.version}</scalaVersion>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+            <properties>
+                <!-- default Spring profiles -->
+                <spring.profiles.active>dev,swagger</spring.profiles.active>
+            </properties>
+        </profile>
+        <profile>
+            <!--
+                Profile for monitoring the application with Graphite.
+            -->
+            <id>graphite</id>
+            <dependencies>
+                <dependency>
+                    <groupId>io.dropwizard.metrics</groupId>
+                    <artifactId>metrics-graphite</artifactId>
+                </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <!--
+                Profile for monitoring the application with Prometheus.
+            -->
+            <id>prometheus</id>
+            <dependencies>
+                <dependency>
+                    <groupId>io.prometheus</groupId>
+                    <artifactId>simpleclient</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>io.prometheus</groupId>
+                    <artifactId>simpleclient_servlet</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>io.prometheus</groupId>
+                    <artifactId>simpleclient_dropwizard</artifactId>
+                </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <!--
+                Profile for applying IDE-specific configuration.
+                At the moment it configures MapStruct and Hibernate JPA Metamodel Generator, which you need when working
+                with DTOs and entity filtering.
+            -->
+            <id>IDE</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.mapstruct</groupId>
+                    <artifactId>mapstruct-processor</artifactId>
+                    <version>${mapstruct.version}</version>
+                </dependency>
+                <dependency>
+                    <groupId>org.hibernate</groupId>
+                    <artifactId>hibernate-jpamodelgen</artifactId>
+                    <version>${hibernate.version}</version>
+                </dependency>
+            </dependencies>
+        </profile>
+        <!-- jhipster-needle-maven-add-profile -->
+    </profiles>
+</project>