Last active
February 8, 2020 03:27
-
-
Save bnlucas/3e9db7d67aa52e43e8013a0cb81b40b3 to your computer and use it in GitHub Desktop.
pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bnlucas.app.config; | |
import com.codahale.metrics.MetricRegistry; | |
import com.bnlucas.components.ldap.LdapClient; | |
import com.bnlucas.app.config.liquibase.AsyncSpringLiquibase; | |
import com.bnlucas.app.domain.AppAuditorAware; | |
import com.bnlucas.springbootextras.config.Constants; | |
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module; | |
import com.zaxxer.hikari.HikariDataSource; | |
import liquibase.integration.spring.SpringLiquibase; | |
import org.h2.tools.Server; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; | |
import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; | |
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.context.ApplicationContextException; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.core.env.Environment; | |
import org.springframework.data.domain.AuditorAware; | |
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | |
import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; | |
import org.springframework.orm.hibernate4.LocalSessionFactoryBean; | |
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; | |
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; | |
import org.springframework.transaction.annotation.EnableTransactionManagement; | |
import javax.inject.Inject; | |
import javax.persistence.EntityManagerFactory; | |
import javax.sql.DataSource; | |
import java.sql.SQLException; | |
import java.util.Arrays; | |
@Configuration | |
public class DatabaseConfiguration { | |
private final static Logger LOG = LoggerFactory.getLogger(DatabaseConfiguration.class); | |
@Inject | |
private Environment env; | |
@Value("${ldap.enabled}") | |
private boolean ldapEnabled; | |
@Value("${ldap.adminUserName}") | |
private String adminUserName; | |
@Value("${ldap.appUserName}") | |
private String appUserName; | |
@Value("${liquibase.enabled}") | |
private boolean liquibaseEnabled = true; | |
@Autowired(required = false) | |
private MetricRegistry metricRegistry; | |
@Bean(destroyMethod = "close") | |
@ConfigurationProperties(prefix = "spring.datasource.hikari") | |
public DataSource dataSource(DataSourceProperties dataSourceProperties) { | |
LOG.debug("Configuring Datasource"); | |
if (dataSourceProperties.getUrl() == null) { | |
LOG.error("Your database connection pool configuration is incorrect! The application" + | |
" cannot start. Please check your Spring profile, current profiles are: {}", | |
Arrays.toString(env.getActiveProfiles())); | |
throw new ApplicationContextException("Database connection pool is not configured correctly"); | |
} | |
if(env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT, Constants.SPRING_PROFILE_TEST, Constants.SPRING_PROFILE_ACCEPTANCE_L1)) { | |
dataSourceProperties.setPassword(""); | |
} else { | |
if (ldapEnabled) { | |
dataSourceProperties.setPassword(LdapClient.getPassword(appUserName)); | |
} | |
} | |
HikariDataSource hikariDataSource = (HikariDataSource) dataSourceProperties | |
.initializeDataSourceBuilder() | |
.type(HikariDataSource.class) | |
.driverClassName(dataSourceProperties.getDriverClassName()) | |
.url(dataSourceProperties.getUrl()) | |
.username(dataSourceProperties.getUsername()) | |
.password(dataSourceProperties.getPassword()) | |
.build(); | |
if (metricRegistry != null) { | |
hikariDataSource.setMetricRegistry(metricRegistry); | |
} | |
return hikariDataSource; | |
} | |
@Bean(initMethod = "start", destroyMethod = "stop") | |
@Profile({Constants.SPRING_PROFILE_DEVELOPMENT, Constants.SPRING_PROFILE_ACCEPTANCE_L1}) | |
public Server h2TCPServer() throws SQLException { | |
return Server.createTcpServer("-tcp", "-tcpAllowOthers"); | |
} | |
@Bean | |
public SpringLiquibase liquibase(DataSource dataSource, DataSourceProperties dataSourceProperties, | |
LiquibaseProperties liquibaseProperties) { | |
SpringLiquibase liquibase = new AsyncSpringLiquibase(); | |
if(env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT,Constants.SPRING_PROFILE_TEST, Constants.SPRING_PROFILE_ACCEPTANCE_L1)) { | |
liquibase.setDataSource(dataSource); | |
} else { | |
if(ldapEnabled){ | |
dataSourceProperties.setPassword(LdapClient.getPassword(adminUserName)); | |
} | |
//anywhere other than dev we need to use the admin user because it has DDL privileges | |
HikariDataSource ds = (HikariDataSource) dataSourceProperties | |
.initializeDataSourceBuilder() | |
.type(HikariDataSource.class) | |
.driverClassName(dataSourceProperties.getDriverClassName()) | |
.url(dataSourceProperties.getUrl()) | |
.username(adminUserName) | |
.password(dataSourceProperties.getPassword()) | |
.build(); | |
ds.setMaximumPoolSize(1); | |
liquibase.setDataSource(ds); | |
} | |
liquibase.setChangeLog("classpath:config/liquibase/master.xml"); | |
liquibase.setContexts(liquibaseProperties.getContexts()); | |
liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema()); | |
liquibase.setDropFirst(liquibaseProperties.isDropFirst()); | |
liquibase.setShouldRun(liquibaseEnabled); | |
return liquibase; | |
} | |
@Bean | |
public Hibernate4Module hibernate4Module() { | |
return new Hibernate4Module(); | |
} | |
@Bean | |
public AuditorAware<String> auditorProvider() { | |
return new AppAuditorAware(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> | |
<parent> | |
<groupId>com.bnlucas</groupId> | |
<artifactId>app-pom</artifactId> | |
<version>0.0.456-SNAPSHOT</version> | |
<relativePath>..</relativePath> | |
</parent> | |
<artifactId>app</artifactId> | |
<packaging>war</packaging> | |
<version>0.0.456-SNAPSHOT</version> | |
<name>app Maven Webapp</name> | |
<properties> | |
<assertj-core.version>3.3.0</assertj-core.version> | |
<awaitility.version>1.7.0</awaitility.version> | |
<commons-io.version>2.5</commons-io.version> | |
<commons-lang.version>2.6</commons-lang.version> | |
<cxf.version>3.1.16</cxf.version> | |
<debug.suspend>n</debug.suspend> | |
<dropwizard-metrics.version>3.1.2</dropwizard-metrics.version> | |
<hibernate.version>5.0.12.Final</hibernate.version> | |
<hikaricp.version>2.4.3</hikaricp.version> | |
<jackson.version>2.6.7</jackson.version> | |
<jackson.core.version>2.9.9</jackson.core.version> | |
<jackson.core.databind.version>2.9.9.2</jackson.core.databind.version> | |
<jasypt.version>1.9.2</jasypt.version> | |
<java.version>1.8</java.version> | |
<javax.inject.version>1</javax.inject.version> | |
<json-lib.version>2.4</json-lib.version> | |
<liquibase.version>3.4.2</liquibase.version> | |
<liquibase-hibernate4.version>3.5</liquibase-hibernate4.version> | |
<liquibase-slf4j.version>1.2.1</liquibase-slf4j.version> | |
<logback.version>1.2.2</logback.version> | |
<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> | |
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version> | |
<metrics-spark-reporter.version>1.2</metrics-spark-reporter.version> | |
<metrics-spring.version>3.1.3</metrics-spring.version> | |
<org.mapstruct.version>1.2.0.Final</org.mapstruct.version> | |
<org.quartz-scheduler.version>2.3.1</org.quartz-scheduler.version> | |
<org.owasp.version>1.2.2</org.owasp.version> | |
<org.togglz>2.4.1.Final</org.togglz> | |
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory> | |
<run.addResources>false</run.addResources> | |
<sonar.exclusions>src/main/webapp/content/**/*.*, src/main/webapp/bower_components/**/*.*, target/www/**/*.*</sonar.exclusions> | |
<sortpom-maven-plugin.version>2.5.0</sortpom-maven-plugin.version> | |
<spring.boot.version>1.5.20.RELEASE</spring.boot.version> | |
<spring-security.version>4.2.13.RELEASE</spring-security.version> | |
<springfox.version>2.4.0</springfox.version> | |
<surefire.provider.name>org.junit.platform</surefire.provider.name> | |
<surefire.provider.artifactid>junit-platform-surefire-provider</surefire.provider.artifactid> | |
<surefire.provider.version>1.2.0</surefire.provider.version> | |
<unboundid-ldapsdk.version>4.0.5</unboundid-ldapsdk.version> | |
<querydsl.version>4.2.1</querydsl.version> | |
</properties> | |
<dependencyManagement> | |
<dependencies> | |
<dependency> | |
<!-- Import dependency management from Spring Boot --> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-dependencies</artifactId> | |
<version>${spring.boot.version}</version> | |
<type>pom</type> | |
<scope>import</scope> | |
</dependency> | |
</dependencies> | |
</dependencyManagement> | |
<dependencies> | |
<dependency> | |
<groupId>org.owasp.encoder</groupId> | |
<artifactId>encoder</artifactId> | |
<version>${org.owasp.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.unboundid</groupId> | |
<artifactId>unboundid-ldapsdk</artifactId> | |
<version>${unboundid-ldapsdk.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.fasterxml.jackson.core</groupId> | |
<artifactId>jackson-databind</artifactId> | |
<version>${jackson.core.databind.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.fasterxml.jackson.core</groupId> | |
<artifactId>jackson-annotations</artifactId> | |
<version>${jackson.core.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.fasterxml.jackson.core</groupId> | |
<artifactId>jackson-core</artifactId> | |
<version>${jackson.core.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.jasypt</groupId> | |
<artifactId>jasypt</artifactId> | |
<version>${jasypt.version}</version> | |
<scope>compile</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.fasterxml.jackson.datatype</groupId> | |
<artifactId>jackson-datatype-hibernate4</artifactId> | |
<version>${jackson.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.fasterxml.jackson.datatype</groupId> | |
<artifactId>jackson-datatype-hppc</artifactId> | |
<version>${jackson.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.fasterxml.jackson.datatype</groupId> | |
<artifactId>jackson-datatype-json-org</artifactId> | |
<version>${jackson.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.fasterxml.jackson.datatype</groupId> | |
<artifactId>jackson-datatype-jsr310</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>com.h2database</groupId> | |
<artifactId>h2</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>com.jayway.awaitility</groupId> | |
<artifactId>awaitility</artifactId> | |
<version>${awaitility.version}</version> | |
<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>com.mattbertolini</groupId> | |
<artifactId>liquibase-slf4j</artifactId> | |
<version>${liquibase-slf4j.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.ryantenney.metrics</groupId> | |
<artifactId>metrics-spring</artifactId> | |
<version>${metrics-spring.version}</version> | |
<exclusions> | |
<exclusion> | |
<artifactId>metrics-annotation</artifactId> | |
<groupId>com.codahale.metrics</groupId> | |
</exclusion> | |
<exclusion> | |
<artifactId>metrics-core</artifactId> | |
<groupId>com.codahale.metrics</groupId> | |
</exclusion> | |
<exclusion> | |
<artifactId>metrics-healthchecks</artifactId> | |
<groupId>com.codahale.metrics</groupId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>com.zaxxer</groupId> | |
<artifactId>HikariCP</artifactId> | |
<exclusions> | |
<exclusion> | |
<artifactId>tools</artifactId> | |
<groupId>com.sun</groupId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>commons-io</groupId> | |
<artifactId>commons-io</artifactId> | |
<version>${commons-io.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>commons-lang</groupId> | |
<artifactId>commons-lang</artifactId> | |
<version>${commons-lang.version}</version> | |
</dependency> | |
<!-- reporting --> | |
<dependency> | |
<groupId>fr.ippon.spark.metrics</groupId> | |
<artifactId>metrics-spark-reporter</artifactId> | |
<version>${metrics-spark-reporter.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-annotation</artifactId> | |
<version>${dropwizard-metrics.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-core</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-ehcache</artifactId> | |
<version>${dropwizard-metrics.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-graphite</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-healthchecks</artifactId> | |
<version>${dropwizard-metrics.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-json</artifactId> | |
<version>${dropwizard-metrics.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-jvm</artifactId> | |
<version>${dropwizard-metrics.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-servlet</artifactId> | |
<version>${dropwizard-metrics.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.dropwizard.metrics</groupId> | |
<artifactId>metrics-servlets</artifactId> | |
<exclusions> | |
<exclusion> | |
<artifactId>metrics-healthchecks</artifactId> | |
<groupId>io.dropwizard.metrics</groupId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>io.springfox</groupId> | |
<artifactId>springfox-swagger2</artifactId> | |
<version>${springfox.version}</version> | |
<!-- Excluding mapstruct since we use the jdk 8 version: https://github.com/mapstruct/mapstruct/issues/841 --> | |
<exclusions> | |
<exclusion> | |
<groupId>org.mapstruct</groupId> | |
<artifactId>mapstruct</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>io.springfox</groupId> | |
<artifactId>springfox-swagger-ui</artifactId> | |
<version>${springfox.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>javax.inject</groupId> | |
<artifactId>javax.inject</artifactId> | |
<version>${javax.inject.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>javax.el</groupId> | |
<artifactId>javax.el-api</artifactId> | |
<version>2.2.4</version> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.web</groupId> | |
<artifactId>javax.el</artifactId> | |
<version>2.2.4</version> | |
</dependency> | |
<dependency> | |
<groupId>mysql</groupId> | |
<artifactId>mysql-connector-java</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>net.sf.json-lib</groupId> | |
<artifactId>json-lib</artifactId> | |
<version>${json-lib.version}</version> | |
<classifier>jdk15</classifier> | |
</dependency> | |
<dependency> | |
<groupId>org.junit.jupiter</groupId> | |
<artifactId>junit-jupiter-api</artifactId> | |
<version>5.4.0</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.junit.jupiter</groupId> | |
<artifactId>junit-jupiter-engine</artifactId> | |
<version>5.4.0</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.junit.jupiter</groupId> | |
<artifactId>junit-jupiter-params</artifactId> | |
<version>5.4.0</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.mockito</groupId> | |
<artifactId>mockito-core</artifactId> | |
<version>2.25.0</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.mockito</groupId> | |
<artifactId>mockito-junit-jupiter</artifactId> | |
<version>2.25.0</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.hamcrest</groupId> | |
<artifactId>hamcrest-library</artifactId> | |
<version>1.3</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>4.12</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.assertj</groupId> | |
<artifactId>assertj-core</artifactId> | |
<version>${assertj-core.version}</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>log4j</groupId> | |
<artifactId>log4j</artifactId> | |
<version>1.2.17</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-core</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-entitymanager</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-ehcache</artifactId> | |
<version>${hibernate.version}</version> | |
<exclusions> | |
<exclusion> | |
<artifactId>ehcache-core</artifactId> | |
<groupId>net.sf.ehcache</groupId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-envers</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-validator</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.liquibase</groupId> | |
<artifactId>liquibase-core</artifactId> | |
<exclusions> | |
<exclusion> | |
<artifactId>jetty-servlet</artifactId> | |
<groupId>org.eclipse.jetty</groupId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-context-support</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-actuator</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-autoconfigure</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-configuration-processor</artifactId> | |
<optional>true</optional> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-loader-tools</artifactId> | |
</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-hateoas</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-logging</artifactId> | |
<exclusions> | |
<!--Excluding logback-classic and logback-core because the version included (1.1.11 has vulerabilities) --> | |
<exclusion> | |
<groupId>ch.qos.logback</groupId> | |
<artifactId>logback-classic</artifactId> | |
</exclusion> | |
<exclusion> | |
<groupId>ch.qos.logback</groupId> | |
<artifactId>logback-core</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-security</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-starter-web</artifactId> | |
<exclusions> | |
<exclusion> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
<groupId>org.springframework.boot</groupId> | |
</exclusion> | |
<exclusion> | |
<artifactId>hibernate-validator</artifactId> | |
<groupId>org.hibernate</groupId> | |
</exclusion> | |
<exclusion> | |
<artifactId>spring-boot-starter-logging</artifactId> | |
<groupId>org.springframework.boot</groupId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.security</groupId> | |
<artifactId>spring-security-data</artifactId> | |
<version>${spring-security.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.security</groupId> | |
<artifactId>spring-security-core</artifactId> | |
<version>${spring-security.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.security</groupId> | |
<artifactId>spring-security-config</artifactId> | |
<version>${spring-security.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>de.codecentric</groupId> | |
<artifactId>spring-boot-admin-starter-client</artifactId> | |
<version>1.5.2</version> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.cxf</groupId> | |
<artifactId>cxf-rt-rs-client</artifactId> | |
<version>${cxf.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.cxf</groupId> | |
<artifactId>cxf-rt-frontend-jaxrs</artifactId> | |
<version>${cxf.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.cxf</groupId> | |
<artifactId>cxf-rt-features-metrics</artifactId> | |
<version>${cxf.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.cxf</groupId> | |
<artifactId>cxf-rt-transports-http</artifactId> | |
<version>${cxf.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.togglz</groupId> | |
<artifactId>togglz-spring-boot-starter</artifactId> | |
<version>${org.togglz}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.togglz</groupId> | |
<artifactId>togglz-spring-security</artifactId> | |
<version>${org.togglz}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.togglz</groupId> | |
<artifactId>togglz-console</artifactId> | |
<version>${org.togglz}</version> | |
</dependency> | |
<dependency> | |
<groupId>javax.cache</groupId> | |
<artifactId>cache-api</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.ehcache</groupId> | |
<artifactId>ehcache</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.retry</groupId> | |
<artifactId>spring-retry</artifactId> | |
<version>1.2.0.RELEASE</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-jdbc</artifactId> | |
</dependency> | |
<!-- Map Struct --> | |
<dependency> | |
<groupId>org.mapstruct</groupId> | |
<artifactId>mapstruct-jdk8</artifactId> | |
<version>${org.mapstruct.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-test</artifactId> | |
<version>1.4.2.RELEASE</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.quartz-scheduler</groupId> | |
<artifactId>quartz</artifactId> | |
<version>${org.quartz-scheduler.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>io.github.prashant-ramcharan</groupId> | |
<artifactId>courgette-jvm</artifactId> | |
<version>3.1.0</version> | |
</dependency> | |
<dependency> | |
<groupId>info.cukes</groupId> | |
<artifactId>cucumber-picocontainer</artifactId> | |
<version>1.2.5</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>io.rest-assured</groupId> | |
<artifactId>rest-assured</artifactId> | |
<version>3.3.0</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>net.sourceforge.htmlunit</groupId> | |
<artifactId>htmlunit</artifactId> | |
<version>2.34.1</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.querydsl</groupId> | |
<artifactId>querydsl-apt</artifactId> | |
<version>${querydsl.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.querydsl</groupId> | |
<artifactId>querydsl-jpa</artifactId> | |
<version>${querydsl.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>ch.qos.logback</groupId> | |
<artifactId>logback-classic</artifactId> | |
<version>${logback.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>ch.qos.logback</groupId> | |
<artifactId>logback-core</artifactId> | |
<version>${logback.version}</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<defaultGoal>spring-boot:run</defaultGoal> | |
<resources> | |
<resource> | |
<filtering>true</filtering> | |
<directory>src/main/resources/</directory> | |
<includes> | |
<include>**/*.yml</include> | |
</includes> | |
</resource> | |
<resource> | |
<filtering>true</filtering> | |
<directory>src/main/resources/</directory> | |
<includes> | |
<include>**/*.xml</include> | |
</includes> | |
</resource> | |
<resource> | |
<filtering>false</filtering> | |
<directory>src/main/resources/</directory> | |
<excludes> | |
<exclude>**/*.xml</exclude> | |
</excludes> | |
</resource> | |
<resource> | |
<directory>../config</directory> | |
<includes> | |
<include>build-${project.artifactId}.properties</include> | |
</includes> | |
<targetPath>WEB-INF/classes</targetPath> | |
<filtering>true</filtering> | |
</resource> | |
<resource> | |
<directory>../config</directory> | |
<includes> | |
<include>build-${project.artifactId}.properties</include> | |
</includes> | |
<targetPath>META-INF</targetPath> | |
<filtering>true</filtering> | |
</resource> | |
</resources> | |
<testResources> | |
<testResource> | |
<directory>src/test/resources/</directory> | |
</testResource> | |
<testResource> | |
<directory>src/test/features</directory> | |
</testResource> | |
</testResources> | |
<finalName>app</finalName> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-javadoc-plugin</artifactId> | |
<configuration> | |
<additionalDependencies> | |
<additionalDependency> | |
<groupId>javax.interceptor</groupId> | |
<artifactId>javax.interceptor-api</artifactId> | |
<version>1.2</version> | |
</additionalDependency> | |
</additionalDependencies> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-resources-plugin</artifactId> | |
<version>2.7</version> | |
<configuration> | |
<delimiters> | |
<delimiter>@</delimiter> | |
</delimiters> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.5.1</version> | |
<configuration> | |
<source>1.8</source> | |
<target>1.8</target> | |
<annotationProcessorPaths> | |
<!-- Mapstruct --> | |
<path> | |
<groupId>org.mapstruct</groupId> | |
<artifactId>mapstruct-processor</artifactId> | |
<version>${org.mapstruct.version}</version> | |
</path> | |
</annotationProcessorPaths> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-release-plugin</artifactId> | |
<version>2.5</version> | |
<configuration> | |
<tagNameFormat>@{project.version}</tagNameFormat> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-war-plugin</artifactId> | |
<version>2.4</version> | |
<configuration> | |
<webResources> | |
<resource> | |
<!-- this is relative to the pom.xml directory --> | |
<directory>config</directory> | |
<includes> | |
<include>build-${project.artifactId}.properties</include> | |
</includes> | |
<!-- override the destination directory for this resource --> | |
<targetPath>META-INF</targetPath> | |
<!-- enable filtering --> | |
<filtering>true</filtering> | |
</resource> | |
<resource> | |
<!-- this is relative to the pom.xml directory --> | |
<directory>config</directory> | |
<includes> | |
<include>build-${project.artifactId}.properties</include> | |
</includes> | |
<!-- override the destination directory for this resource --> | |
<targetPath>WEB-INF/classes</targetPath> | |
<!-- enable filtering --> | |
<filtering>true</filtering> | |
</resource> | |
<resource> | |
<directory>.</directory> | |
<targetPath>META-INF</targetPath> | |
<filtering>true</filtering> | |
</resource> | |
</webResources> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.jfrog.buildinfo</groupId> | |
<artifactId>artifactory-maven-plugin</artifactId> | |
<version>2.2.1</version> | |
<inherited>false</inherited> | |
<executions> | |
<execution> | |
<id>build-info</id> | |
<goals> | |
<goal>publish</goal> | |
</goals> | |
<configuration> | |
<publisher> | |
<repoKey>libs-release-stage-local</repoKey> | |
<snapshotRepoKey>libs-snapshot-local</snapshotRepoKey> | |
</publisher> | |
<buildInfo> | |
<buildName>{{JOB_NAME}}</buildName> | |
<buildNumber>{{BUILD_NUMBER}}</buildNumber> | |
</buildInfo> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.liquibase</groupId> | |
<artifactId>liquibase-maven-plugin</artifactId> | |
<version>${liquibase.version}</version> | |
<dependencies> | |
<dependency> | |
<groupId>org.javassist</groupId> | |
<artifactId>javassist</artifactId> | |
<version>3.21.0-GA</version> | |
</dependency> | |
<dependency> | |
<groupId>org.liquibase.ext</groupId> | |
<artifactId>liquibase-hibernate4</artifactId> | |
<version>${liquibase-hibernate4.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-data-jpa</artifactId> | |
<version>${spring.boot.version}</version> | |
<exclusions> | |
<exclusion> | |
<groupId>org.javassist</groupId> | |
<artifactId>javassist</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
</dependencies> | |
<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/app</url> | |
<defaultSchemaName /> | |
<username>app</username> | |
<password /> | |
<referenceUrl>hibernate:spring:com.bnlucas.app.domain?dialect=org.hibernate.dialect.H2Dialect&hibernate.ejb.naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy</referenceUrl> | |
<verbose>true</verbose> | |
<logging>debug</logging> | |
</configuration> | |
</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> | |
<executable>true</executable> | |
<!-- | |
Enable the line below to have remote debugging of your application on port 5005--> | |
<jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${debug.suspend},address=5005 | |
-Dlog4j.configuration=file:${basedir}/etc/log4j.properties | |
-Dldap.ssl.trustStore=/etc/pki/tls/certs/cacerts | |
-Dldap.application.identity=app | |
</jvmArguments> | |
<arguments> | |
<argument>--spring.profiles.active=acceptance-l1</argument> | |
</arguments> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.jacoco</groupId> | |
<artifactId>jacoco-maven-plugin</artifactId> | |
</plugin> | |
<plugin> | |
<groupId>com.mysema.maven</groupId> | |
<artifactId>apt-maven-plugin</artifactId> | |
<version>1.1.3</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>process</goal> | |
</goals> | |
<configuration> | |
<outputDirectory>target/generated-sources/java</outputDirectory> | |
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor> | |
</configuration> | |
</execution> | |
</executions> | |
</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.--> | |
<plugin> | |
<groupId>org.eclipse.m2e</groupId> | |
<artifactId>lifecycle-mapping</artifactId> | |
<version>1.0.0</version> | |
<configuration> | |
<lifecycleMappingMetadata> | |
<pluginExecutions> | |
<pluginExecution> | |
<pluginExecutionFilter> | |
<groupId> | |
org.jfrog.buildinfo | |
</groupId> | |
<artifactId> | |
artifactory-maven-plugin | |
</artifactId> | |
<versionRange> | |
[2.2.1,) | |
</versionRange> | |
<goals> | |
<goal>publish</goal> | |
</goals> | |
</pluginExecutionFilter> | |
<action> | |
<ignore /> | |
</action> | |
</pluginExecution> | |
</pluginExecutions> | |
</lifecycleMappingMetadata> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>versions-maven-plugin</artifactId> | |
<version>2.3</version> | |
</plugin> | |
</plugins> | |
</pluginManagement> | |
</build> | |
<profiles> | |
<profile> | |
<id>integration</id> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-war-plugin</artifactId> | |
<version>2.4</version> | |
<configuration> | |
<failOnMissingWebXml>false</failOnMissingWebXml> | |
<warSourceDirectory>src/main/webapp/</warSourceDirectory> | |
<packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<version>2.22.0</version> | |
<configuration> | |
<!--<forkMode>never</forkMode>--> | |
<excludes> | |
<exclude>**/runners/*IT.class</exclude> | |
</excludes> | |
</configuration> | |
<dependencies> | |
<dependency> | |
<groupId>org.apache.maven.surefire</groupId> | |
<artifactId>surefire-junit47</artifactId> | |
<version>2.22.0</version> | |
</dependency> | |
</dependencies> | |
</plugin> | |
</plugins> | |
</build> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
</dependency> | |
</dependencies> | |
</profile> | |
<profile> | |
<id>dev</id> | |
<activation> | |
<activeByDefault>true</activeByDefault> | |
</activation> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-war-plugin</artifactId> | |
<version>2.4</version> | |
<configuration> | |
<failOnMissingWebXml>false</failOnMissingWebXml> | |
<warSourceDirectory>src/main/webapp/</warSourceDirectory> | |
<packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<version>2.22.0</version> | |
<configuration> | |
<!--<forkMode>never</forkMode>--> | |
<excludes> | |
<exclude>**/runners/*IT.class</exclude> | |
</excludes> | |
</configuration> | |
<dependencies> | |
<dependency> | |
<groupId>org.junit.platform</groupId> | |
<artifactId>junit-platform-surefire-provider</artifactId> | |
<version>1.2.0</version> | |
</dependency> | |
</dependencies> | |
</plugin> | |
</plugins> | |
</build> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
</dependency> | |
</dependencies> | |
</profile> | |
<profile> | |
<id>debug</id> | |
<properties> | |
<debug.suspend>y</debug.suspend> | |
</properties> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-war-plugin</artifactId> | |
<version>2.4</version> | |
<configuration> | |
<failOnMissingWebXml>false</failOnMissingWebXml> | |
<warSourceDirectory>src/main/webapp/</warSourceDirectory> | |
<packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-maven-plugin</artifactId> | |
<version>${spring.boot.version}</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>run</goal> | |
</goals> | |
</execution> | |
</executions> | |
<configuration> | |
<executable>true</executable> | |
<jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${debug.suspend},address=5005 | |
-Dlog4j.configuration=file:${basedir}/etc/log4j.properties | |
-Dldap.ssl.trustStore=/etc/pki/tls/certs/cacerts | |
-Dldap.application.identity=app | |
</jvmArguments> | |
<arguments> | |
<argument>--spring.profiles.active=acceptance-l1</argument> | |
</arguments> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
</dependency> | |
</dependencies> | |
</profile> | |
<profile> | |
<id>artifactory-plugin</id> | |
<build> | |
<plugins> | |
<plugin> | |
<artifactId>maven-clean-plugin</artifactId> | |
<version>2.5</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>2.4</version> | |
<configuration> | |
<failOnMissingWebXml>false</failOnMissingWebXml> | |
<warSourceDirectory>target/www/</warSourceDirectory> | |
<packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-maven-plugin</artifactId> | |
<executions> | |
<execution> | |
<goals> | |
<goal>build-info</goal> | |
</goals> | |
</execution> | |
</executions> | |
<configuration> | |
<executable>true</executable> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
</profile> | |
</profiles> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment