diff --git a/generators/client/index.js b/generators/client/index.js index cbe92905280c..a4ba2d8c7f8f 100644 --- a/generators/client/index.js +++ b/generators/client/index.js @@ -490,7 +490,7 @@ module.exports = JhipsterClientGenerator.extend({ this.template(ANGULAR_DIR + 'components/util/_jhi-item-count.directive.js', ANGULAR_DIR + 'components/util/jhi-item-count.directive.js', this, {}); // interceptor code - if (this.authenticationType === 'oauth2' || this.authenticationType === 'jwt' || this.authenticationType == 'uaa') { + if (this.authenticationType === 'oauth2' || this.authenticationType === 'jwt' || this.authenticationType === 'uaa') { this.template(ANGULAR_DIR + 'blocks/interceptor/_auth.interceptor.js', ANGULAR_DIR + 'blocks/interceptor/auth.interceptor.js', this, {}); } this.template(ANGULAR_DIR + 'blocks/interceptor/_auth-expired.interceptor.js', ANGULAR_DIR + 'blocks/interceptor/auth-expired.interceptor.js', this, {}); diff --git a/generators/client/templates/src/main/webapp/app/blocks/config/_http.config.js b/generators/client/templates/src/main/webapp/app/blocks/config/_http.config.js index 992134320628..2313a7f6d36a 100644 --- a/generators/client/templates/src/main/webapp/app/blocks/config/_http.config.js +++ b/generators/client/templates/src/main/webapp/app/blocks/config/_http.config.js @@ -19,7 +19,7 @@ $urlRouterProvider.otherwise('/'); $httpProvider.interceptors.push('errorHandlerInterceptor'); - $httpProvider.interceptors.push('authExpiredInterceptor');<% if (authenticationType == 'oauth2' || authenticationType == 'jwt' || authenticationType == 'uaa') { %> + $httpProvider.interceptors.push('authExpiredInterceptor');<% if (authenticationType === 'oauth2' || authenticationType === 'jwt' || authenticationType === 'uaa') { %> $httpProvider.interceptors.push('authInterceptor');<% } %> $httpProvider.interceptors.push('notificationInterceptor'); // jhipster-needle-angularjs-add-interceptor JHipster will add new application http interceptor here diff --git a/generators/client/templates/src/main/webapp/app/services/auth/_account.service.js b/generators/client/templates/src/main/webapp/app/services/auth/_account.service.js index aff08526fdd6..7970efd444f7 100644 --- a/generators/client/templates/src/main/webapp/app/services/auth/_account.service.js +++ b/generators/client/templates/src/main/webapp/app/services/auth/_account.service.js @@ -8,7 +8,7 @@ Account.$inject = ['$resource']; function Account ($resource) { - var service = $resource(<% if(authenticationType == 'uaa') { %>'<%= uaaBaseName %>/api/account'<%} else { %>'api/account'<% } %>, {}, { + var service = $resource(<% if(authenticationType === 'uaa') { %>'<%= uaaBaseName %>/api/account'<%} else { %>'api/account'<% } %>, {}, { 'get': { method: 'GET', params: {}, isArray: false, interceptor: { response: function(response) { diff --git a/generators/client/templates/src/main/webapp/app/services/auth/_activate.service.js b/generators/client/templates/src/main/webapp/app/services/auth/_activate.service.js index 5704aec3e3e7..696c4daf944d 100644 --- a/generators/client/templates/src/main/webapp/app/services/auth/_activate.service.js +++ b/generators/client/templates/src/main/webapp/app/services/auth/_activate.service.js @@ -8,7 +8,7 @@ Activate.$inject = ['$resource']; function Activate ($resource) { - var service = $resource(<% if(authenticationType == 'uaa') { %>'<%= uaaBaseName %>/api/activate'<%} else { %>'api/activate'<% } %>, {}, { + var service = $resource(<% if(authenticationType === 'uaa') { %>'<%= uaaBaseName %>/api/activate'<%} else { %>'api/activate'<% } %>, {}, { 'get': { method: 'GET', params: {}, isArray: false} }); diff --git a/generators/client/templates/src/main/webapp/app/services/auth/_auth.jwt.service.js b/generators/client/templates/src/main/webapp/app/services/auth/_auth.jwt.service.js index ad9c9f8d902d..d01cfebf9e50 100644 --- a/generators/client/templates/src/main/webapp/app/services/auth/_auth.jwt.service.js +++ b/generators/client/templates/src/main/webapp/app/services/auth/_auth.jwt.service.js @@ -29,7 +29,7 @@ } function login (credentials) { - <% if(authenticationType == 'uaa') { %> + <% if(authenticationType === 'uaa') { %> var data = { username: credentials.username, password: credentials.password, diff --git a/generators/client/templates/src/main/webapp/app/services/auth/_auth.session.service.js b/generators/client/templates/src/main/webapp/app/services/auth/_auth.session.service.js index 4c52a0141bc9..31fb126a952d 100644 --- a/generators/client/templates/src/main/webapp/app/services/auth/_auth.session.service.js +++ b/generators/client/templates/src/main/webapp/app/services/auth/_auth.session.service.js @@ -5,9 +5,9 @@ .module('<%=angularAppName%>') .factory('AuthServerProvider', AuthServerProvider); - AuthServerProvider.$inject = ['$http', '$localStorage' <% if (websocket == 'spring-websocket') { %>, '<%=jhiPrefixCapitalized%>TrackerService'<% } %>]; + AuthServerProvider.$inject = ['$http', '$localStorage' <% if (websocket === 'spring-websocket') { %>, '<%=jhiPrefixCapitalized%>TrackerService'<% } %>]; - function AuthServerProvider ($http, $localStorage <% if (websocket == 'spring-websocket') { %>, <%=jhiPrefixCapitalized%>TrackerService<% } %>) { + function AuthServerProvider ($http, $localStorage <% if (websocket === 'spring-websocket') { %>, <%=jhiPrefixCapitalized%>TrackerService<% } %>) { var service = { getToken: getToken, hasValidToken: hasValidToken, @@ -41,10 +41,10 @@ }); } - function logout () {<% if (websocket == 'spring-websocket') { %> + function logout () {<% if (websocket === 'spring-websocket') { %> <%=jhiPrefixCapitalized%>TrackerService.disconnect();<% } %> - <% if(authenticationType == 'uaa') { %> + <% if(authenticationType === 'uaa') { %> delete $localStorage.authenticationToken; <% } else { %> // logout from the server diff --git a/generators/client/templates/src/main/webapp/app/services/auth/_password-reset-finish.service.js b/generators/client/templates/src/main/webapp/app/services/auth/_password-reset-finish.service.js index b1156422c137..cc5600919833 100644 --- a/generators/client/templates/src/main/webapp/app/services/auth/_password-reset-finish.service.js +++ b/generators/client/templates/src/main/webapp/app/services/auth/_password-reset-finish.service.js @@ -8,7 +8,7 @@ PasswordResetFinish.$inject = ['$resource']; function PasswordResetFinish($resource) { - var service = $resource(<% if(authenticationType == 'uaa') { %>'<%= uaaBaseName %>/api/account/reset_password/finish'<%} else { %>'api/account/reset_password/finish'<% } %>, {}, {}); + var service = $resource(<% if(authenticationType === 'uaa') { %>'<%= uaaBaseName %>/api/account/reset_password/finish'<%} else { %>'api/account/reset_password/finish'<% } %>, {}, {}); return service; } diff --git a/generators/client/templates/src/main/webapp/app/services/auth/_password-reset-init.service.js b/generators/client/templates/src/main/webapp/app/services/auth/_password-reset-init.service.js index 7a104ac78e76..2f42c9deb3fe 100644 --- a/generators/client/templates/src/main/webapp/app/services/auth/_password-reset-init.service.js +++ b/generators/client/templates/src/main/webapp/app/services/auth/_password-reset-init.service.js @@ -8,7 +8,7 @@ PasswordResetInit.$inject = ['$resource']; function PasswordResetInit($resource) { - var service = $resource(<% if(authenticationType == 'uaa') { %>'<%= uaaBaseName %>/api/account/reset_password/init'<%} else { %>'api/account/reset_password/init'<% } %>, {}, {}); + var service = $resource(<% if(authenticationType === 'uaa') { %>'<%= uaaBaseName %>/api/account/reset_password/init'<%} else { %>'api/account/reset_password/init'<% } %>, {}, {}); return service; } diff --git a/generators/client/templates/src/main/webapp/app/services/auth/_password.service.js b/generators/client/templates/src/main/webapp/app/services/auth/_password.service.js index 4f64884eddd1..d1bc6c7c9080 100644 --- a/generators/client/templates/src/main/webapp/app/services/auth/_password.service.js +++ b/generators/client/templates/src/main/webapp/app/services/auth/_password.service.js @@ -8,7 +8,7 @@ Password.$inject = ['$resource']; function Password($resource) { - var service = $resource(<% if(authenticationType == 'uaa') { %>'<%= uaaBaseName %>/api/account/change_password'<%} else { %>'api/account/change_password'<% } %>, {}, {}); + var service = $resource(<% if(authenticationType === 'uaa') { %>'<%= uaaBaseName %>/api/account/change_password'<%} else { %>'api/account/change_password'<% } %>, {}, {}); return service; } diff --git a/generators/client/templates/src/main/webapp/app/services/auth/_register.service.js b/generators/client/templates/src/main/webapp/app/services/auth/_register.service.js index ab668d5f8e46..e37f19cecde4 100644 --- a/generators/client/templates/src/main/webapp/app/services/auth/_register.service.js +++ b/generators/client/templates/src/main/webapp/app/services/auth/_register.service.js @@ -8,6 +8,6 @@ Register.$inject = ['$resource']; function Register ($resource) { - return $resource(<% if(authenticationType == 'uaa') { %>'<%= uaaBaseName %>/api/register'<%} else { %>'api/register'<% } %>, {}, {}); + return $resource(<% if(authenticationType === 'uaa') { %>'<%= uaaBaseName %>/api/register'<%} else { %>'api/register'<% } %>, {}, {}); } })(); diff --git a/generators/client/templates/src/main/webapp/app/services/user/_user.service.js b/generators/client/templates/src/main/webapp/app/services/user/_user.service.js index f7483066c429..c19cd02f7adb 100644 --- a/generators/client/templates/src/main/webapp/app/services/user/_user.service.js +++ b/generators/client/templates/src/main/webapp/app/services/user/_user.service.js @@ -8,7 +8,7 @@ User.$inject = ['$resource']; function User ($resource) { - var service = $resource(<% if(authenticationType == 'uaa') { %>'<%= uaaBaseName %>/api/users/:login'<%} else { %>'api/users/:login'<% } %>, {}, { + var service = $resource(<% if(authenticationType === 'uaa') { %>'<%= uaaBaseName %>/api/users/:login'<%} else { %>'api/users/:login'<% } %>, {}, { 'query': {method: 'GET', isArray: true}, 'get': { method: 'GET', diff --git a/generators/client/templates/src/test/javascript/spec/app/services/auth/_auth.services.spec.js b/generators/client/templates/src/test/javascript/spec/app/services/auth/_auth.services.spec.js index 82bcef2abd3b..8ffacaa17245 100644 --- a/generators/client/templates/src/test/javascript/spec/app/services/auth/_auth.services.spec.js +++ b/generators/client/templates/src/test/javascript/spec/app/services/auth/_auth.services.spec.js @@ -16,7 +16,7 @@ describe('Service Tests', function () { sessionStorageService = $sessionStorage; authService = Auth; spiedAuthServerProvider = AuthServerProvider; - <%_ if (authenticationType != 'jwt' && authenticationType != 'uaa') { _%> + <%_ if (authenticationType !== 'jwt' && authenticationType !== 'uaa') { _%> $httpBackend.expectPOST(/api\/logout\?cacheBuster=\d+/).respond(200, ''); <%_ } _%> })); diff --git a/generators/server/index.js b/generators/server/index.js index afeb62980519..68151e9bb6f2 100644 --- a/generators/server/index.js +++ b/generators/server/index.js @@ -282,7 +282,7 @@ module.exports = JhipsterServerGenerator.extend({ }, { when: function (response) { - return applicationType === 'gateway' || applicationType == 'microservice'; + return applicationType === 'gateway' || applicationType === 'microservice'; }, type: 'list', name: 'authenticationType', @@ -298,7 +298,7 @@ module.exports = JhipsterServerGenerator.extend({ }, { value: 'uaa', - name: 'Authentication via JHipster UAA (you will have to generate one separately)' + name: 'Authentication via JHipster UAA (you will have to generate app separately)' } ], default: 0 @@ -316,9 +316,9 @@ module.exports = JhipsterServerGenerator.extend({ message: function (response) { return getNumberedQuestion('What is the path of your UAA application?.', currentQuestion, totalQuestions, function (current) { currentQuestion = current; - }, true); + }, applicationType === 'gateway' && response.authenticationType === 'uaa'); }, - default: 'uaa' + default: 'jhipsterUAA' }, { when: function (response) { @@ -685,11 +685,11 @@ module.exports = JhipsterServerGenerator.extend({ } //this now is job for uaa - if(this.applicationType == 'gateway' && this.authenticationType == 'uaa') { + if(this.applicationType === 'gateway' && this.authenticationType === 'uaa') { this.skipUserManagement = true; } - if(applicationType == 'uaa') { + if(applicationType === 'uaa') { this.authenticationType = 'uaa'; } @@ -902,7 +902,7 @@ module.exports = JhipsterServerGenerator.extend({ this.template(DOCKER_DIR + '_elasticsearch.yml', DOCKER_DIR + 'elasticsearch.yml', this, {}); } - if (this.applicationType == 'microservice' || this.applicationType == 'gateway' || this.applicationType == 'uaa') { + if (this.applicationType === 'microservice' || this.applicationType === 'gateway' || this.applicationType === 'uaa') { this.template(DOCKER_DIR + '_jhipster-registry.yml', DOCKER_DIR + 'jhipster-registry.yml', this, {}); } this.template(DOCKER_DIR + '_sonar.yml', DOCKER_DIR + 'sonar.yml', this, {}); @@ -1005,7 +1005,7 @@ module.exports = JhipsterServerGenerator.extend({ /* Skip the code below for --skip-user-management */ if (this.skipUserManagement) return; - if(this.applicationType == 'uaa') { + if(this.applicationType === 'uaa') { this.template(SERVER_MAIN_SRC_DIR + 'package/config/_UaaWebSecurityConfiguration.java', javaDir + 'config/UaaWebSecurityConfiguration.java', this, {}); this.template(SERVER_MAIN_SRC_DIR + 'package/config/_UaaConfiguration.java', javaDir + 'config/UaaConfiguration.java', this, {}); } else { @@ -1022,7 +1022,7 @@ module.exports = JhipsterServerGenerator.extend({ this.template(SERVER_MAIN_SRC_DIR + 'package/security/_UserNotActivatedException.java', javaDir + 'security/UserNotActivatedException.java', this, {}); - if (this.authenticationType == 'jwt') { + if (this.authenticationType === 'jwt') { this.template(SERVER_MAIN_SRC_DIR + 'package/web/rest/dto/_LoginDTO.java', javaDir + 'web/rest/dto/LoginDTO.java', this, {}); this.template(SERVER_MAIN_SRC_DIR + 'package/web/rest/_UserJWTController.java', javaDir + 'web/rest/UserJWTController.java', this, {}); this.template(SERVER_MAIN_SRC_DIR + 'package/web/rest/_JWTToken.java', javaDir + 'web/rest/JWTToken.java', this, {}); diff --git a/generators/server/templates/_build.gradle b/generators/server/templates/_build.gradle index 38ca944714f0..a52ea22ac762 100644 --- a/generators/server/templates/_build.gradle +++ b/generators/server/templates/_build.gradle @@ -26,7 +26,7 @@ apply plugin: 'maven' apply plugin: 'spring-boot' apply plugin: 'war' apply plugin: 'propdeps' -<%_ if (applicationType == 'microservice' || applicationType == 'gateway' || applicationType == 'uaa') { _%> +<%_ if (applicationType === 'microservice' || applicationType === 'gateway' || applicationType === 'uaa') { _%> apply plugin: 'io.spring.dependency-management' dependencyManagement { imports { @@ -80,7 +80,7 @@ cucumberTest.finalizedBy(testReport) <% if(!skipClient) {%> apply from: 'gradle/yeoman.gradle'<% } %> apply from: 'gradle/sonar.gradle' -<% if (databaseType == 'sql') { %> +<% if (databaseType === 'sql') { %> apply from: 'gradle/liquibase.gradle'<% } %> <% if (testFrameworks.indexOf('gatling') != -1) { %> apply from: 'gradle/gatling.gradle'<% } %> @@ -113,7 +113,7 @@ repositories { } dependencies { - compile group: 'io.dropwizard.metrics', name: 'metrics-core'<% if (hibernateCache == 'ehcache') { %> + compile group: 'io.dropwizard.metrics', name: 'metrics-core'<% if (hibernateCache === 'ehcache') { %> compile group: 'io.dropwizard.metrics', name: 'metrics-annotation', version: dropwizard_metrics_version compile group: 'io.dropwizard.metrics', name: 'metrics-ehcache', version: dropwizard_metrics_version<% } %> compile group: 'io.dropwizard.metrics', name: 'metrics-graphite', version: dropwizard_metrics_version @@ -136,13 +136,13 @@ dependencies { compile (group: 'com.ryantenney.metrics', name: 'metrics-spring', version: metrics_spring_version) { exclude(module: 'metrics-core') exclude(module: 'metrics-healthchecks') - } <% if (hibernateCache == 'hazelcast') { %> + } <% if (hibernateCache === 'hazelcast') { %> compile group: 'com.hazelcast', name: 'hazelcast', version: hazelcast_version compile group: 'com.hazelcast', name: 'hazelcast-hibernate4', version: hazelcast_version - compile group: 'com.hazelcast', name: 'hazelcast-spring', version: hazelcast_version<% } %><% if (clusteredHttpSession == 'hazelcast' && hibernateCache != 'hazelcast') { %> - compile group: 'com.hazelcast', name: 'hazelcast', version: hazelcast_version<% } %><% if (clusteredHttpSession == 'hazelcast') { %> + compile group: 'com.hazelcast', name: 'hazelcast-spring', version: hazelcast_version<% } %><% if (clusteredHttpSession === 'hazelcast' && hibernateCache != 'hazelcast') { %> + compile group: 'com.hazelcast', name: 'hazelcast', version: hazelcast_version<% } %><% if (clusteredHttpSession === 'hazelcast') { %> compile group: 'com.hazelcast', name: 'hazelcast-wm', version: hazelcast_version<% } %> - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> compile(group: 'com.zaxxer', name: 'HikariCP', version: HikariCP_version) { exclude(module: 'tools') } @@ -150,16 +150,16 @@ dependencies { compile group: 'commons-lang', name: 'commons-lang', version: commons_lang_version compile group: 'commons-io', name: 'commons-io', version: commons_io_version compile group: 'javax.inject', name: 'javax.inject', version: javax_inject_version - compile group: 'javax.transaction', name: 'javax.transaction-api'<% if (databaseType == 'cassandra' || applicationType == 'gateway') { %> + compile group: 'javax.transaction', name: 'javax.transaction-api'<% if (databaseType === 'cassandra' || applicationType === 'gateway') { %> compile group: 'net.jpountz.lz4', name: 'lz4', version: lz4_version<% } %> compile group: 'org.apache.geronimo.javamail', name: 'geronimo-javamail_1.4_mail', version: geronimo_javamail_1_4_mail_version compile group: 'org.hibernate', name: 'hibernate-core', version: hibernate_entitymanager_version - <% if (hibernateCache == 'ehcache' && databaseType == 'sql') { %> + <% if (hibernateCache === 'ehcache' && databaseType === 'sql') { %> compile (group: 'org.hibernate', name: 'hibernate-ehcache') { exclude(module: 'ehcache-core') }<% } %> compile group: 'org.hibernate', name: 'hibernate-envers' - compile group: 'org.hibernate', name: 'hibernate-validator'<% if (databaseType == 'sql') { %> + compile group: 'org.hibernate', name: 'hibernate-validator'<% if (databaseType === 'sql') { %> compile (group: 'org.liquibase', name: 'liquibase-core', version: liquibase_core_version) { exclude(module: 'jetty-servlet') } @@ -168,23 +168,23 @@ dependencies { compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure' compile group: 'org.springframework.boot', name: 'spring-boot-loader-tools' compile group: 'org.springframework.boot', name: 'spring-boot-starter-logging' - compile group: 'org.springframework.boot', name: 'spring-boot-starter-aop'<% if (databaseType == 'sql') { %> - compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa'<% } %><% if (searchEngine == 'elasticsearch') { %> - compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-elasticsearch'<% } %><% if (databaseType == 'mongodb') { %> + compile group: 'org.springframework.boot', name: 'spring-boot-starter-aop'<% if (databaseType === 'sql') { %> + compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa'<% } %><% if (searchEngine === 'elasticsearch') { %> + compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-elasticsearch'<% } %><% if (databaseType === 'mongodb') { %> compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-mongodb'<% } %> compile group: 'org.springframework.boot', name: 'spring-boot-starter-security' - compile(group: 'org.springframework.boot', name: 'spring-boot-starter-web')<% if (websocket == 'spring-websocket') { %> + compile(group: 'org.springframework.boot', name: 'spring-boot-starter-web')<% if (websocket === 'spring-websocket') { %> compile group: 'org.springframework.boot', name: 'spring-boot-starter-websocket'<% } %> - compile group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf'<% if (databaseType == 'cassandra' || applicationType == 'gateway') { %> + compile group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf'<% if (databaseType === 'cassandra' || applicationType === 'gateway') { %> compile group: 'org.springframework.data', name: 'spring-data-cassandra' compile(group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: datastax_driver_version) { exclude module: 'com.codahale.metrics' } compile group: 'com.datastax.cassandra', name: 'cassandra-driver-mapping', version: datastax_driver_version<% } %> - <%_ if (applicationType == 'gateway') { _%> + <%_ if (applicationType === 'gateway') { _%> compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-zuul' <%_ } _%> - <%_ if (applicationType == 'microservice' || applicationType == 'gateway' || applicationType == 'uaa') { _%> + <%_ if (applicationType === 'microservice' || applicationType === 'gateway' || applicationType === 'uaa') { _%> compile group: 'org.springframework.cloud', name: 'spring-cloud-starter' compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-ribbon' compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka' @@ -200,26 +200,26 @@ dependencies { } compile group: 'org.springframework.security', name: 'spring-security-config', version: spring_security_version compile group: 'org.springframework.security', name: 'spring-security-data', version: spring_security_version - compile group: 'org.springframework.security', name: 'spring-security-web', version: spring_security_version<% if (websocket == 'spring-websocket') { %> + compile group: 'org.springframework.security', name: 'spring-security-web', version: spring_security_version<% if (websocket === 'spring-websocket') { %> compile group: 'org.springframework.security', name: 'spring-security-messaging', version: spring_security_version <% } %> - <%_ if (authenticationType == 'oauth2') { _%> + <%_ if (authenticationType === 'oauth2') { _%> compile group: 'org.springframework.security.oauth', name: 'spring-security-oauth2', version: spring_security_oauth2_version <%_ } _%> - <%_ if (authenticationType == 'jwt') { _%> + <%_ if (authenticationType === 'jwt') { _%> compile group: 'io.jsonwebtoken', name: 'jjwt', version: jjwt_version <%_ } _%> - <%_ if (applicationType == 'uaa' || authenticationType == 'uaa') { _%> + <%_ if (authenticationType === 'uaa') { _%> compile group: 'org.springframework.security.oauth', name: 'spring-security-oauth2' compile group: 'org.springframework.security', name: 'spring-security-jwt' <%_ } _%> - <%_ if (databaseType == 'mongodb') { _%> + <%_ if (databaseType === 'mongodb') { _%> compile group: 'org.mongeez', name: 'mongeez', version: mongeez_version<% } %> compile(group: 'io.springfox', name: 'springfox-swagger2', version: springfox_version){ exclude module: 'mapstruct' } - <% if (devDatabaseType == 'mysql' || prodDatabaseType == 'mysql') { %> - compile group: 'mysql', name: 'mysql-connector-java'<% } %><% if (devDatabaseType == 'postgresql' || prodDatabaseType == 'postgresql') { %> - compile group: 'org.postgresql', name: 'postgresql', version: postgresql_version<% } %><% if (devDatabaseType == 'h2Disk' || devDatabaseType == 'h2Memory') { %> + <% if (devDatabaseType === 'mysql' || prodDatabaseType === 'mysql') { %> + compile group: 'mysql', name: 'mysql-connector-java'<% } %><% if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { %> + compile group: 'org.postgresql', name: 'postgresql', version: postgresql_version<% } %><% if (devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { %> compile group: 'com.h2database', name: 'h2'<% } %> compile group: 'fr.ippon.spark.metrics', name: 'metrics-spark-reporter', version: metrics_spark_reporter_version compile group: 'org.mapstruct', name: 'mapstruct-jdk8', version: mapstruct_version<% if (enableSocialSignIn) { %> @@ -229,7 +229,7 @@ dependencies { compile group: 'org.springframework.social', name: 'spring-social-facebook', version: spring_social_facebook_version compile group: 'org.springframework.social', name: 'spring-social-twitter', version: spring_social_twitter_version<% } %> testCompile group: 'com.jayway.awaitility', name: 'awaitility', version: awaility_version - testCompile group: 'com.jayway.jsonpath', name: 'json-path'<% if (databaseType == 'cassandra') { %> + testCompile group: 'com.jayway.jsonpath', name: 'json-path'<% if (databaseType === 'cassandra') { %> testCompile(group: 'org.cassandraunit', name: 'cassandra-unit-spring', version: cassandra_unit_spring_version) { exclude(module: 'org.slf4j') }<% } %><% if (testFrameworks.indexOf('cucumber') != -1) { %> @@ -238,14 +238,14 @@ dependencies { testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test' testCompile group: 'org.assertj', name: 'assertj-core', version: assertj_core_version testCompile group: 'junit', name: 'junit' - testCompile group: 'org.mockito', name: 'mockito-core'<% if (databaseType == 'sql') { %> - testCompile group: 'com.mattbertolini', name: 'liquibase-slf4j', version: liquibase_slf4j_version<% } %><% if (databaseType == 'mongodb') { %> + testCompile group: 'org.mockito', name: 'mockito-core'<% if (databaseType === 'sql') { %> + testCompile group: 'com.mattbertolini', name: 'liquibase-slf4j', version: liquibase_slf4j_version<% } %><% if (databaseType === 'mongodb') { %> testCompile group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo'<% } %> testCompile group: 'org.hamcrest', name: 'hamcrest-library' <% if (testFrameworks.indexOf('gatling') != -1) { %> testCompile group: 'io.gatling.highcharts', name: 'gatling-charts-highcharts', version: gatling_version<% } %> <% if (devDatabaseType != 'h2Disk' && devDatabaseType != 'h2Memory') { %> - testCompile group: 'com.h2database', name: 'h2'<% } %><% if (devDatabaseType == 'oracle' || prodDatabaseType == 'oracle') { %> + testCompile group: 'com.h2database', name: 'h2'<% } %><% if (devDatabaseType === 'oracle' || prodDatabaseType === 'oracle') { %> runtime files('lib/oracle/ojdbc/7/ojdbc-7.jar') runtime fileTree(dir: 'lib', include: '*.jar')<% } %> optional group: 'org.springframework.boot', name:'spring-boot-configuration-processor', version: spring_boot_version diff --git a/generators/server/templates/_pom.xml b/generators/server/templates/_pom.xml index 255dc30d9f02..f2bb8c4482f3 100644 --- a/generators/server/templates/_pom.xml +++ b/generators/server/templates/_pom.xml @@ -20,7 +20,7 @@ spring-milestones http://repo.spring.io/milestone - <%_ if (devDatabaseType == 'oracle' || prodDatabaseType == 'oracle') { _%> + <%_ if (devDatabaseType === 'oracle' || prodDatabaseType === 'oracle') { _%> Local-lib file://${project.basedir}/lib @@ -39,7 +39,7 @@ - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> 2.4.3 <%_ } _%> 3.3.0 @@ -53,25 +53,25 @@ 2.1.7 2.1.7 <%_ } _%> - <%_ if (clusteredHttpSession == 'hazelcast' || hibernateCache == 'hazelcast') { _%> + <%_ if (clusteredHttpSession === 'hazelcast' || hibernateCache === 'hazelcast') { _%> 3.6.1 <%_ } _%> - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> 4.3.11.Final <%_ } _%> - <%_ if (databaseType == 'cassandra' || applicationType == 'gateway') { _%> + <%_ if (databaseType === 'cassandra' || applicationType === 'gateway') { _%> 2.1.7.1 <%_ } _%> 1.<%= javaVersion %> ${java.version} ${java.version} 1 - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> 3.4.2 1.2.1 3.5 <%_ } _%> - <%_ if (databaseType == 'cassandra' || applicationType == 'gateway') { _%> + <%_ if (databaseType === 'cassandra' || applicationType === 'gateway') { _%> 1.3.0 <%_ } _%> 1.0.0.Final @@ -81,15 +81,15 @@ 1.2 3.1.3 4.6 - <%_ if (devDatabaseType == 'postgresql' || prodDatabaseType == 'postgresql') { _%> + <%_ if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { _%> 9.4-1203-jdbc42 <%_ } _%> false - <%_ if (applicationType == 'microservice' || applicationType == 'gateway' || applicationType == 'uaa') { _%> + <%_ if (applicationType === 'microservice' || applicationType === 'gateway' || applicationType === 'uaa') { _%> Brixton.RC1 <%_ } _%> 4.0.4.RELEASE - <%_ if (authenticationType == 'oauth2' || authenticationType == 'uaa' || applicationType == 'uaa') { _%> + <%_ if (authenticationType === 'oauth2' || authenticationType === 'uaa') { _%> 2.0.9.RELEASE <%_ } _%> 2.4.0 @@ -118,7 +118,7 @@ ${project.basedir}/<%= TEST_DIR %> - <%_ if (applicationType == 'microservice' || applicationType == 'gateway') { _%> + <%_ if (applicationType === 'microservice' || applicationType === 'gateway') { _%> @@ -142,7 +142,7 @@ metrics-annotation ${dropwizard-metrics.version} - <%_ if (hibernateCache == 'ehcache') { _%> + <%_ if (hibernateCache === 'ehcache') { _%> io.dropwizard.metrics metrics-ehcache @@ -183,7 +183,7 @@ - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> com.fasterxml.jackson.datatype jackson-datatype-hibernate4 @@ -211,14 +211,14 @@ test <%_ } _%> - <%_ if (hibernateCache == 'hazelcast' || clusteredHttpSession == 'hazelcast') { _%> + <%_ if (hibernateCache === 'hazelcast' || clusteredHttpSession === 'hazelcast') { _%> com.hazelcast hazelcast ${hazelcast.version} <%_ } _%> - <%_ if (hibernateCache == 'hazelcast') { _%> + <%_ if (hibernateCache === 'hazelcast') { _%> com.hazelcast hazelcast-hibernate4 @@ -230,7 +230,7 @@ ${hazelcast.version} <%_ } _%> - <%_ if (clusteredHttpSession == 'hazelcast') { _%> + <%_ if (clusteredHttpSession === 'hazelcast') { _%> com.hazelcast hazelcast-wm @@ -260,7 +260,7 @@ - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> com.mattbertolini liquibase-slf4j @@ -286,7 +286,7 @@ - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> com.zaxxer HikariCP @@ -315,7 +315,7 @@ commons-lang ${commons-lang.version} - <%_ if (databaseType == 'mongodb') { _%> + <%_ if (databaseType === 'mongodb') { _%> de.flapdoodle.embed de.flapdoodle.embed.mongo @@ -335,20 +335,20 @@ javax.inject ${javax.inject.version} - <%_ if (devDatabaseType == 'mysql' || prodDatabaseType == 'mysql') { _%> + <%_ if (devDatabaseType === 'mysql' || prodDatabaseType === 'mysql') { _%> mysql mysql-connector-java <%_ } _%> - <%_ if (databaseType == 'cassandra' || applicationType == 'gateway') { _%> + <%_ if (databaseType === 'cassandra' || applicationType === 'gateway') { _%> net.jpountz.lz4 lz4 ${lz4.version} <%_ } _%> - <%_ if (devDatabaseType == 'oracle' || prodDatabaseType == 'oracle') { _%> + <%_ if (devDatabaseType === 'oracle' || prodDatabaseType === 'oracle') { _%> oracle ojdbc @@ -361,7 +361,7 @@ ${assertj-core.version} test - <%_ if (databaseType == 'cassandra') { _%> + <%_ if (databaseType === 'cassandra') { _%> org.cassandraunit cassandra-unit-spring @@ -375,7 +375,7 @@ <%_ } _%> - <%_ if (hibernateCache == 'ehcache' && databaseType == 'sql') { _%> + <%_ if (hibernateCache === 'ehcache' && databaseType === 'sql') { _%> org.hibernate hibernate-ehcache @@ -396,7 +396,7 @@ org.hibernate hibernate-validator - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> org.liquibase liquibase-core @@ -408,14 +408,14 @@ <%_ } _%> - <%_ if (databaseType == 'mongodb') { _%> + <%_ if (databaseType === 'mongodb') { _%> org.mongeez mongeez 0.9.6 <%_ } _%> - <%_ if (devDatabaseType == 'postgresql' || prodDatabaseType == 'postgresql') { _%> + <%_ if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { _%> org.postgresql postgresql @@ -452,19 +452,19 @@ org.springframework.boot spring-boot-starter-aop - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> org.springframework.boot spring-boot-starter-data-jpa <%_ } _%> - <%_ if (searchEngine == 'elasticsearch') { _%> + <%_ if (searchEngine === 'elasticsearch') { _%> org.springframework.boot spring-boot-starter-data-elasticsearch <%_ } _%> - <%_ if (databaseType == 'mongodb') { _%> + <%_ if (databaseType === 'mongodb') { _%> org.springframework.boot spring-boot-starter-data-mongodb @@ -501,27 +501,27 @@ - <%_ if (websocket == 'spring-websocket') { _%> + <%_ if (websocket === 'spring-websocket') { _%> org.springframework.boot spring-boot-starter-websocket <%_ } _%> - <%_ if (authenticationType == 'oauth2') { _%> + <%_ if (authenticationType === 'oauth2') { _%> org.springframework.security.oauth spring-security-oauth2 ${spring-security-oauth2.version} <%_ } _%> - <%_ if (authenticationType == 'jwt') { _%> + <%_ if (authenticationType === 'jwt') { _%> io.jsonwebtoken jjwt 0.6.0 <%_ } _%> - <%_ if (authenticationType == 'uaa') { _%> + <%_ if (authenticationType === 'uaa') { _%> org.springframework.security.oauth spring-security-oauth2 @@ -532,7 +532,7 @@ spring-security-jwt <%_ } _%> - <%_ if (databaseType == 'cassandra' || applicationType == 'gateway') { _%> + <%_ if (databaseType === 'cassandra' || applicationType === 'gateway') { _%> org.springframework.data spring-data-cassandra @@ -556,13 +556,13 @@ <%_ } _%> - <%_ if (applicationType == 'gateway') { _%> + <%_ if (applicationType === 'gateway') { _%> org.springframework.cloud spring-cloud-starter-zuul <%_ } _%> - <%_ if (applicationType == 'microservice' || applicationType == 'gateway' || applicationType == 'uaa') { _%> + <%_ if (applicationType === 'microservice' || applicationType === 'gateway' || applicationType === 'uaa') { _%> org.springframework.cloud spring-cloud-starter @@ -624,7 +624,7 @@ org.springframework.security spring-security-data - <%_ if (websocket == 'spring-websocket') { _%> + <%_ if (websocket === 'spring-websocket') { _%> org.springframework.security spring-security-messaging @@ -884,7 +884,7 @@ - <%_ if (databaseType == 'sql') { _%> + <%_ if (databaseType === 'sql') { _%> org.liquibase liquibase-maven-plugin @@ -892,15 +892,15 @@ <%= SERVER_MAIN_RES_DIR %>config/liquibase/master.xml <%= SERVER_MAIN_RES_DIR %>config/liquibase/changelog/${maven.build.timestamp}_changelog.xml - <% if (devDatabaseType == 'mysql') { %>com.mysql.jdbc.Driver<% } else if (devDatabaseType == 'postgresql') { %>org.postgresql.Driver<% } else if (devDatabaseType == 'h2Disk') { %>org.h2.Driver<% } else if (devDatabaseType == 'oracle') { %>oracle.jdbc.OracleDriver<% } %> - <% if (devDatabaseType == 'mysql') { %>jdbc:mysql://localhost:3306/<%= baseName %><% } else if (devDatabaseType == 'postgresql') { %>jdbc:postgresql://localhost:5432/<%= baseName %><% } else if (devDatabaseType == 'h2Disk') { %>jdbc:h2:file:./target/h2db/db/<%= lowercaseBaseName %><% } else if (devDatabaseType == 'oracle') { %>jdbc:oracle:thin:@localhost:1521:<%= baseName %><% } %> - <% if (devDatabaseType == 'mysql') { %><%= baseName %><% } else if (devDatabaseType == 'postgresql') { %><% } %> - <% if (devDatabaseType == 'mysql') { %>root<% } else if (devDatabaseType == 'postgresql' || devDatabaseType == 'h2Disk' || devDatabaseType == 'h2Memory') { %><%= baseName %><% } %> + <% if (devDatabaseType === 'mysql') { %>com.mysql.jdbc.Driver<% } else if (devDatabaseType === 'postgresql') { %>org.postgresql.Driver<% } else if (devDatabaseType === 'h2Disk') { %>org.h2.Driver<% } else if (devDatabaseType === 'oracle') { %>oracle.jdbc.OracleDriver<% } %> + <% if (devDatabaseType === 'mysql') { %>jdbc:mysql://localhost:3306/<%= baseName %><% } else if (devDatabaseType === 'postgresql') { %>jdbc:postgresql://localhost:5432/<%= baseName %><% } else if (devDatabaseType === 'h2Disk') { %>jdbc:h2:file:./target/h2db/db/<%= lowercaseBaseName %><% } else if (devDatabaseType === 'oracle') { %>jdbc:oracle:thin:@localhost:1521:<%= baseName %><% } %> + <% if (devDatabaseType === 'mysql') { %><%= baseName %><% } else if (devDatabaseType === 'postgresql') { %><% } %> + <% if (devDatabaseType === 'mysql') { %>root<% } else if (devDatabaseType === 'postgresql' || devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { %><%= baseName %><% } %> - hibernate:spring:<%=packageName%>.domain?dialect=<% if (devDatabaseType == 'mysql') { %>org.hibernate.dialect.MySQLInnoDBDialect<% } else if (devDatabaseType == 'postgresql') { %>org.hibernate.dialect.PostgreSQL82Dialect<% } else if (devDatabaseType == 'h2Disk') { %>org.hibernate.dialect.H2Dialect<% } else if (devDatabaseType == 'oracle') { %>org.hibernate.dialect.Oracle10gDialect<% } %>&hibernate.ejb.naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy + hibernate:spring:<%=packageName%>.domain?dialect=<% if (devDatabaseType === 'mysql') { %>org.hibernate.dialect.MySQLInnoDBDialect<% } else if (devDatabaseType === 'postgresql') { %>org.hibernate.dialect.PostgreSQL82Dialect<% } else if (devDatabaseType === 'h2Disk') { %>org.hibernate.dialect.H2Dialect<% } else if (devDatabaseType === 'oracle') { %>org.hibernate.dialect.Oracle10gDialect<% } %>&hibernate.ejb.naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy true debug - <%_ if (authenticationType == 'oauth2') { _%> + <%_ if (authenticationType === 'oauth2') { _%> oauth_access_token, oauth_approvals, oauth_client_details, oauth_client_token, oauth_code, oauth_refresh_token <%_ } _%> diff --git a/generators/server/templates/src/main/resources/config/_application.yml b/generators/server/templates/src/main/resources/config/_application.yml index 1b5e70885f5b..fbec11912335 100644 --- a/generators/server/templates/src/main/resources/config/_application.yml +++ b/generators/server/templates/src/main/resources/config/_application.yml @@ -29,11 +29,7 @@ zuul: spring: application: - <%_ if (applicationType == 'uaa') { _%> - name: uaa - <%_ } else { _%> name: <%= baseName %> - <%_ } _%> <%_ if (databaseType == 'sql') { _%> jpa: open-in-view: false