diff --git a/boms/bom/pom.xml b/boms/bom/pom.xml index 02f5cc895..bc0f87474 100644 --- a/boms/bom/pom.xml +++ b/boms/bom/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 - 3.1.9 + 3.2.5 7.5.1 bom @@ -108,12 +108,6 @@ cglib 3.2.5 - - - com.querydsl - querydsl-jpa - 4.1.4 - org.apache.commons @@ -143,7 +137,7 @@ javax.ws.rs javax.ws.rs-api - 2.0.1 + 2.1 @@ -181,6 +175,12 @@ cxf-rt-rs-client ${cxf.version} + + + org.json + json + 20180130 + com.fasterxml.jackson.jaxrs @@ -240,7 +240,7 @@ javax.el javax.el-api - 2.2.4 + 3.0.0 org.glassfish.web diff --git a/modules/batch/src/main/java/io/oasp/module/batch/common/base/SpringBootBatchCommandLine.java b/modules/batch/src/main/java/io/oasp/module/batch/common/base/SpringBootBatchCommandLine.java index 5ff059bf3..598b6db91 100644 --- a/modules/batch/src/main/java/io/oasp/module/batch/common/base/SpringBootBatchCommandLine.java +++ b/modules/batch/src/main/java/io/oasp/module/batch/common/base/SpringBootBatchCommandLine.java @@ -167,13 +167,13 @@ public void execute(Operation operation, List configurations, String job throws Exception { // get sources of configuration - Object[] configurationObjects = new Object[configurations.size()]; + Class[] configurationClasses = new Class[configurations.size()]; for (int i = 0; i < configurations.size(); i++) { - configurationObjects[i] = getConfiguration(configurations.get(i)); + configurationClasses[i] = Class.forName(configurations.get(i)); } - SpringApplication app = new SpringApplication(configurationObjects); + SpringApplication app = new SpringApplication(configurationClasses); // no (web) server needed app.setWebEnvironment(false); @@ -182,14 +182,14 @@ public void execute(Operation operation, List configurations, String job ConfigurableApplicationContext ctx = app.run(new String[0]); switch (operation) { - case START: - startBatch(ctx, jobName, parameters); - break; - case STOP: - stopBatch(ctx, jobName); - break; - default: - throw new RuntimeException("Unknown operation: " + operation); + case START: + startBatch(ctx, jobName, parameters); + break; + case STOP: + stopBatch(ctx, jobName); + break; + default: + throw new RuntimeException("Unknown operation: " + operation); } } diff --git a/modules/jpa-basic/src/main/java/io/oasp/module/jpa/dataaccess/api/QueryHelper.java b/modules/jpa-basic/src/main/java/io/oasp/module/jpa/dataaccess/api/QueryHelper.java index 3b22b78fc..185e29548 100644 --- a/modules/jpa-basic/src/main/java/io/oasp/module/jpa/dataaccess/api/QueryHelper.java +++ b/modules/jpa-basic/src/main/java/io/oasp/module/jpa/dataaccess/api/QueryHelper.java @@ -368,7 +368,7 @@ protected Page findPaginatedGeneric(Pageable pageable, JPAQuery query, if (determineTotal) { total = query.clone().fetchCount(); } - int offset = 0; + long offset = 0; if (pageable != null) { offset = pageable.getOffset(); query.offset(offset); diff --git a/modules/jpa-dao/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractGenericDao.java b/modules/jpa-dao/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractGenericDao.java index e681946e8..ec021bfa6 100644 --- a/modules/jpa-dao/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractGenericDao.java +++ b/modules/jpa-dao/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractGenericDao.java @@ -228,4 +228,4 @@ public void delete(Iterable entities) { } } -} +} \ No newline at end of file diff --git a/modules/jpa-spring-data/src/main/java/io/oasp/module/jpa/dataaccess/api/data/GenericRepository.java b/modules/jpa-spring-data/src/main/java/io/oasp/module/jpa/dataaccess/api/data/GenericRepository.java index c4b9303b6..11e3a3018 100644 --- a/modules/jpa-spring-data/src/main/java/io/oasp/module/jpa/dataaccess/api/data/GenericRepository.java +++ b/modules/jpa-spring-data/src/main/java/io/oasp/module/jpa/dataaccess/api/data/GenericRepository.java @@ -5,7 +5,6 @@ import java.io.Serializable; import java.util.Collection; -import net.sf.mmm.util.exception.api.ObjectNotFoundException; import net.sf.mmm.util.exception.api.ObjectNotFoundUserException; import org.springframework.data.jpa.repository.JpaRepository; @@ -42,16 +41,11 @@ public interface GenericRepository /** * @param id the {@link net.sf.mmm.util.entity.api.PersistenceEntity#getId() primary key}. May not be {@code null}. * @return the requested entity. Never {@code null}. - * @throws ObjectNotFoundException if the requested entity does not exist. - * @see #findOne(java.io.Serializable) + * @see #findById(java.io.Serializable) */ - default E find(ID id) throws ObjectNotFoundException { + default E find(ID id) { - E entity = findOne(id); - if (entity == null) { - throw new ObjectNotFoundUserException(getEntityClass(), id); - } - return entity; + return findById(id).orElseThrow(() -> new ObjectNotFoundUserException(getEntityClass(), id)); } /** diff --git a/modules/logging/pom.xml b/modules/logging/pom.xml index 9f2b9b7b0..589a84b9f 100644 --- a/modules/logging/pom.xml +++ b/modules/logging/pom.xml @@ -51,6 +51,10 @@ oasp4j-test test + + org.springframework.boot + spring-boot-starter + \ No newline at end of file diff --git a/modules/logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFilter.java b/modules/logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFilter.java index be18d24cf..6ab156c83 100644 --- a/modules/logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFilter.java +++ b/modules/logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFilter.java @@ -15,6 +15,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.context.WebApplicationContext; import io.oasp.module.logging.common.api.DiagnosticContextFacade; @@ -39,6 +41,9 @@ public class DiagnosticContextFilter implements Filter { /** @see #setCorrelationIdHttpHeaderName(String) */ private String correlationIdHttpHeaderName; + @Autowired + private WebApplicationContext webApplicationContext; + private DiagnosticContextFacade diagnosticContextFacade; /** @@ -141,8 +146,8 @@ public void init(FilterConfig config) throws ServletException { // ClassNotFoundException and use the fallback in the catch statement. ServletContext servletContext = config.getServletContext(); org.springframework.web.context.WebApplicationContext springContext; - springContext = - org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(servletContext); + springContext = org.springframework.web.context.support.WebApplicationContextUtils + .getWebApplicationContext(servletContext); this.diagnosticContextFacade = springContext.getBean(DiagnosticContextFacade.class); } catch (Throwable e) { LOG.warn("DiagnosticContextFacade not defined in spring. Falling back to default", e); diff --git a/modules/logging/src/test/java/io/oasp/module/logging/common/impl/DiagnosticContextFilterTest.java b/modules/logging/src/test/java/io/oasp/module/logging/common/impl/DiagnosticContextFilterTest.java index e7706438a..908996d02 100644 --- a/modules/logging/src/test/java/io/oasp/module/logging/common/impl/DiagnosticContextFilterTest.java +++ b/modules/logging/src/test/java/io/oasp/module/logging/common/impl/DiagnosticContextFilterTest.java @@ -35,8 +35,8 @@ public void testCorrelationIdHttpHeaderNameAfterConstructor() { DiagnosticContextFilter filter = new DiagnosticContextFilter(); // exercise - String correlationIdHttpHeaderName = - (String) ReflectionTestUtils.getField(filter, CORRELATION_ID_HEADER_NAME_PARAM); + String correlationIdHttpHeaderName = (String) ReflectionTestUtils.getField(filter, + CORRELATION_ID_HEADER_NAME_PARAM); // verify assertThat(correlationIdHttpHeaderName).isNotNull(); @@ -56,8 +56,8 @@ public void testInitWithNullInitParameter() throws Exception { filter.init(this.config); // verify - String correlationIdHttpHeaderName = - (String) ReflectionTestUtils.getField(filter, CORRELATION_ID_HEADER_NAME_PARAM); + String correlationIdHttpHeaderName = (String) ReflectionTestUtils.getField(filter, + CORRELATION_ID_HEADER_NAME_PARAM); assertThat(correlationIdHttpHeaderName).isNotNull() .isEqualTo(DiagnosticContextFilter.CORRELATION_ID_HEADER_NAME_DEFAULT); } @@ -76,8 +76,8 @@ public void testInitWithNonDefaultParameter() throws Exception { // exercise filter.init(this.config); // verify - String correlationIdHttpHeaderName = - (String) ReflectionTestUtils.getField(filter, CORRELATION_ID_HEADER_NAME_PARAM); + String correlationIdHttpHeaderName = (String) ReflectionTestUtils.getField(filter, + CORRELATION_ID_HEADER_NAME_PARAM); assertThat(correlationIdHttpHeaderName).isEqualTo(nonDefaultParameter); } } diff --git a/modules/rest/pom.xml b/modules/rest/pom.xml index ad71094a7..b156fcfe2 100644 --- a/modules/rest/pom.xml +++ b/modules/rest/pom.xml @@ -65,7 +65,7 @@ test - org.hibernate + org.hibernate.validator hibernate-validator test diff --git a/modules/service/src/main/java/io/oasp/module/service/common/impl/discovery/ServiceDiscovererImplConfig.java b/modules/service/src/main/java/io/oasp/module/service/common/impl/discovery/ServiceDiscovererImplConfig.java index 86dbb89ca..62f67fa2e 100644 --- a/modules/service/src/main/java/io/oasp/module/service/common/impl/discovery/ServiceDiscovererImplConfig.java +++ b/modules/service/src/main/java/io/oasp/module/service/common/impl/discovery/ServiceDiscovererImplConfig.java @@ -3,7 +3,7 @@ import javax.inject.Inject; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent; +import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.context.ApplicationListener; import io.oasp.module.basic.common.api.config.ConfigProperties; @@ -24,8 +24,7 @@ * * @since 3.0.0 */ -public class ServiceDiscovererImplConfig - implements ServiceDiscoverer, ApplicationListener { +public class ServiceDiscovererImplConfig implements ServiceDiscoverer, ApplicationListener { // @Value("${local.server.port}") private int localServerPort; @@ -45,9 +44,9 @@ public void setConfig(ServiceConfig config) { } @Override - public void onApplicationEvent(EmbeddedServletContainerInitializedEvent event) { + public void onApplicationEvent(WebServerInitializedEvent event) { - this.localServerPort = event.getEmbeddedServletContainer().getPort(); + this.localServerPort = event.getWebServer().getPort(); } @Override @@ -107,8 +106,8 @@ private String resolveVariables(String url2, String application) { String resolvedUrl = url2; resolvedUrl = resolvedUrl.replace(ServiceConstants.VARIABLE_APP, application); - resolvedUrl = - resolvedUrl.replace(ServiceConstants.VARIABLE_LOCAL_SERVER_PORT, Integer.toString(this.localServerPort)); + resolvedUrl = resolvedUrl.replace(ServiceConstants.VARIABLE_LOCAL_SERVER_PORT, + Integer.toString(this.localServerPort)); return resolvedUrl; } diff --git a/modules/test/pom.xml b/modules/test/pom.xml index d6ba121df..a8aae7d13 100644 --- a/modules/test/pom.xml +++ b/modules/test/pom.xml @@ -22,7 +22,6 @@ org.springframework.boot spring-boot-starter-test - org.mockito mockito-core diff --git a/pom.xml b/pom.xml index 053f2c0ce..7f7deeec4 100644 --- a/pom.xml +++ b/pom.xml @@ -19,12 +19,12 @@ - 1.7 + 1.8 UTF-8 UTF-8 - 3.0.0-SNAPSHOT + 3.0.0-alpha.1 oss - 1.5.3.RELEASE + 2.0.4.RELEASE 3.0.1 @@ -338,7 +338,7 @@ org.springframework.boot spring-boot-maven-plugin - 1.5.7.RELEASE + 2.0.4.RELEASE diff --git a/templates/server/src/main/resources/archetype-resources/__batch__/src/main/java/__packageInPathFormat__/SpringBootBatchApp.java b/templates/server/src/main/resources/archetype-resources/__batch__/src/main/java/__packageInPathFormat__/SpringBootBatchApp.java index be57dde56..287fc4187 100644 --- a/templates/server/src/main/resources/archetype-resources/__batch__/src/main/java/__packageInPathFormat__/SpringBootBatchApp.java +++ b/templates/server/src/main/resources/archetype-resources/__batch__/src/main/java/__packageInPathFormat__/SpringBootBatchApp.java @@ -1,11 +1,11 @@ package ${package}; import org.springframework.boot.SpringApplication; -import org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration; -import org.springframework.boot.autoconfigure.security.SecurityFilterAutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import io.oasp.module.jpa.dataaccess.api.AdvancedRevisionEntity; diff --git a/templates/server/src/main/resources/archetype-resources/core/pom.xml b/templates/server/src/main/resources/archetype-resources/core/pom.xml index ea8e7bb62..b688a8246 100644 --- a/templates/server/src/main/resources/archetype-resources/core/pom.xml +++ b/templates/server/src/main/resources/archetype-resources/core/pom.xml @@ -99,7 +99,7 @@ - org.hibernate + org.hibernate.validator hibernate-validator @@ -265,4 +265,4 @@ - + \ No newline at end of file diff --git a/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/logic/impl/UcManageBinaryObjectImpl.java b/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/logic/impl/UcManageBinaryObjectImpl.java index 2676cfad9..b1ea3ffe2 100644 --- a/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/logic/impl/UcManageBinaryObjectImpl.java +++ b/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/logic/impl/UcManageBinaryObjectImpl.java @@ -48,20 +48,20 @@ public BinaryObjectEto saveBinaryObject(Blob data, BinaryObjectEto binaryObjectE @Override public void deleteBinaryObject(Long binaryObjectId) { - this.binaryObjectRepository.delete(binaryObjectId); + this.binaryObjectRepository.deleteById(binaryObjectId); } @Override public BinaryObjectEto findBinaryObject(Long binaryObjectId) { - return getBeanMapper().map(this.binaryObjectRepository.findOne(binaryObjectId), BinaryObjectEto.class); + return getBeanMapper().map(this.binaryObjectRepository.find(binaryObjectId), BinaryObjectEto.class); } @Override public Blob getBinaryObjectBlob(Long binaryObjectId) { - return this.binaryObjectRepository.findOne(binaryObjectId).getData(); + return this.binaryObjectRepository.find(binaryObjectId).getData(); } } diff --git a/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/BaseWebSecurityConfig.java b/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/BaseWebSecurityConfig.java index 8e2b88399..b62f3ee8f 100644 --- a/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/BaseWebSecurityConfig.java +++ b/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/BaseWebSecurityConfig.java @@ -8,6 +8,7 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler; import org.springframework.security.web.authentication.logout.LogoutFilter; @@ -38,6 +39,9 @@ public abstract class BaseWebSecurityConfig extends WebSecurityConfigurerAdapter @Inject private UserDetailsService userDetailsService; + @Inject + private PasswordEncoder passwordEncoder; + private CorsFilter getCorsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); @@ -62,8 +66,8 @@ private CorsFilter getCorsFilter() { @Override public void configure(HttpSecurity http) throws Exception { - String[] unsecuredResources = - new String[] { "/login", "/security/**", "/services/rest/login", "/services/rest/logout" }; + String[] unsecuredResources = new String[] { "/login", "/security/**", "/services/rest/login", + "/services/rest/logout" }; http // @@ -98,8 +102,8 @@ public void configure(HttpSecurity http) throws Exception { */ protected Filter getSimpleRestLogoutFilter() { - LogoutFilter logoutFilter = - new LogoutFilter(new LogoutSuccessHandlerReturningOkHttpStatusCode(), new SecurityContextLogoutHandler()); + LogoutFilter logoutFilter = new LogoutFilter(new LogoutSuccessHandlerReturningOkHttpStatusCode(), + new SecurityContextLogoutHandler()); // configure logout for rest logouts logoutFilter.setLogoutRequestMatcher(new AntPathRequestMatcher("/services/rest/logout")); @@ -116,8 +120,8 @@ protected Filter getSimpleRestLogoutFilter() { */ protected JsonUsernamePasswordAuthenticationFilter getSimpleRestAuthenticationFilter() throws Exception { - JsonUsernamePasswordAuthenticationFilter jsonFilter = - new JsonUsernamePasswordAuthenticationFilter(new AntPathRequestMatcher("/services/rest/login")); + JsonUsernamePasswordAuthenticationFilter jsonFilter = new JsonUsernamePasswordAuthenticationFilter( + new AntPathRequestMatcher("/services/rest/login")); jsonFilter.setPasswordParameter("j_password"); jsonFilter.setUsernameParameter("j_username"); jsonFilter.setAuthenticationManager(authenticationManager()); @@ -133,9 +137,10 @@ protected JsonUsernamePasswordAuthenticationFilter getSimpleRestAuthenticationFi @Inject public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { - auth.inMemoryAuthentication().withUser("waiter").password("waiter").roles("Waiter").and().withUser("cook") - .password("cook").roles("Cook").and().withUser("barkeeper").password("barkeeper").roles("Barkeeper").and() - .withUser("chief").password("chief").roles("Chief"); + auth.inMemoryAuthentication().withUser("waiter").password(this.passwordEncoder.encode("waiter")).roles("Waiter") + .and().withUser("cook").password(this.passwordEncoder.encode("cook")).roles("Cook").and().withUser("barkeeper") + .password(this.passwordEncoder.encode("barkeeper")).roles("Barkeeper").and().withUser("chief") + .password(this.passwordEncoder.encode("chief")).roles("Chief"); } } diff --git a/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/ServletInitializer.java b/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/ServletInitializer.java index 5b02635af..f26cc1740 100644 --- a/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/ServletInitializer.java +++ b/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/ServletInitializer.java @@ -2,7 +2,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.Configuration; import ${package}.SpringBootApp; diff --git a/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/WebSecurityBeansConfig.java b/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/WebSecurityBeansConfig.java index 7f3aae679..405a46f12 100644 --- a/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/WebSecurityBeansConfig.java +++ b/templates/server/src/main/resources/archetype-resources/core/src/main/java/__packageInPathFormat__/general/service/impl/config/WebSecurityBeansConfig.java @@ -2,6 +2,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.security.crypto.factory.PasswordEncoderFactories; +import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.csrf.CsrfTokenRepository; import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; @@ -63,4 +65,15 @@ public static DefaultRolesPrefixPostProcessor defaultRolesPrefixPostProcessor() // We disable this undesired behavior here... return new DefaultRolesPrefixPostProcessor(""); } + + /** + * This method provide a new instance of {@code DelegatingPasswordEncoder}} + * + * @return the newly create {@code DelegatingPasswordEncoder}} + */ + @Bean + public PasswordEncoder passwordEncoder() { + + return PasswordEncoderFactories.createDelegatingPasswordEncoder(); + } } diff --git a/templates/server/src/main/resources/archetype-resources/core/src/main/resources/application.properties b/templates/server/src/main/resources/archetype-resources/core/src/main/resources/application.properties index 4561450bc..ae4cfce1b 100644 --- a/templates/server/src/main/resources/archetype-resources/core/src/main/resources/application.properties +++ b/templates/server/src/main/resources/archetype-resources/core/src/main/resources/application.properties @@ -59,7 +59,7 @@ spring.batch.job.enabled=false # Flyway for Database Setup and Migrations #if ($dbType == 'mariadb') -flyway.locations=classpath:db/migration,classpath:db/type/mysql +#spring.flyway.locations=classpath:db/migration,classpath:db/type/mysql #else -flyway.locations=classpath:db/migration,classpath:db/type/${dbType} +spring.flyway.locations=classpath:db/migration,classpath:db/type/${dbType} #end diff --git a/templates/server/src/main/resources/archetype-resources/core/src/main/resources/config/application.properties b/templates/server/src/main/resources/archetype-resources/core/src/main/resources/config/application.properties index 36ef109e7..6518f5fbd 100644 --- a/templates/server/src/main/resources/archetype-resources/core/src/main/resources/config/application.properties +++ b/templates/server/src/main/resources/archetype-resources/core/src/main/resources/config/application.properties @@ -39,5 +39,5 @@ spring.datasource.url=jdbc:${dbType}:TODO spring.jackson.serialization.INDENT_OUTPUT=true # Flyway for Database Setup and Migrations -flyway.enabled=true -flyway.clean-on-validation-error=true +spring.flyway.enabled=true +spring.flyway.clean-on-validation-error=true diff --git a/templates/server/src/main/resources/archetype-resources/core/src/test/java/__packageInPathFormat__/general/service/base/test/RestServiceTest.java b/templates/server/src/main/resources/archetype-resources/core/src/test/java/__packageInPathFormat__/general/service/base/test/RestServiceTest.java index 73e975ead..df39b334a 100644 --- a/templates/server/src/main/resources/archetype-resources/core/src/test/java/__packageInPathFormat__/general/service/base/test/RestServiceTest.java +++ b/templates/server/src/main/resources/archetype-resources/core/src/test/java/__packageInPathFormat__/general/service/base/test/RestServiceTest.java @@ -2,7 +2,7 @@ import javax.inject.Inject; -import org.springframework.boot.context.embedded.LocalServerPort; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; diff --git a/templates/server/src/main/resources/archetype-resources/core/src/test/resources/config/application.properties b/templates/server/src/main/resources/archetype-resources/core/src/test/resources/config/application.properties index 4f7cd12c1..47b72ef47 100644 --- a/templates/server/src/main/resources/archetype-resources/core/src/test/resources/config/application.properties +++ b/templates/server/src/main/resources/archetype-resources/core/src/test/resources/config/application.properties @@ -9,5 +9,5 @@ spring.datasource.username=sa spring.jpa.hibernate.ddl-auto=none # Flyway for Database Setup and Migrations -flyway.enabled=true -flyway.locations=classpath:db/migration,classpath:db/type/h2 +spring.flyway.enabled=true +spring.flyway.locations=classpath:db/migration,classpath:db/type/h2 diff --git a/templates/server/src/main/resources/archetype-resources/pom.xml b/templates/server/src/main/resources/archetype-resources/pom.xml index e1ccda613..62883268f 100644 --- a/templates/server/src/main/resources/archetype-resources/pom.xml +++ b/templates/server/src/main/resources/archetype-resources/pom.xml @@ -10,10 +10,9 @@ Application based on the Open Application Standard Platform for Java (OASP4J). - 1.5.3.RELEASE + 2.0.4.RELEASE $[oasp4j.version] - 4.2.0 - 1.7 + 1.8 UTF-8 UTF-8 io.oasp.module.test.common.api.category.CategorySystemTest @@ -33,11 +32,6 @@ - - org.flywaydb - flyway-core - ${flyway.version} - org.springframework.boot @@ -293,7 +287,7 @@ org.springframework.boot spring-boot-maven-plugin - 1.5.7.RELEASE + 2.0.4.RELEASE diff --git a/templates/server/src/main/resources/archetype-resources/server/pom.xml b/templates/server/src/main/resources/archetype-resources/server/pom.xml index 1a9bae17b..af0d544bb 100644 --- a/templates/server/src/main/resources/archetype-resources/server/pom.xml +++ b/templates/server/src/main/resources/archetype-resources/server/pom.xml @@ -13,7 +13,7 @@ Server for the ${rootArtifactId} application - a simple example using the Open Application Standard Platform for Java (OASP4J). - 1.7 + 1.8 @@ -29,10 +29,6 @@ ${project.version} #end - - org.flywaydb - flyway-core - @@ -112,6 +108,7 @@ WEB-INF/classes/config/application.properties ${project.artifactId} + false