automatic project update

This commit is contained in:
Julien Dubois 2016-11-14 12:25:47 +01:00
parent d87ea4ec63
commit 34ff4a4fbb
24 changed files with 95 additions and 185 deletions

View File

@ -1,4 +1,4 @@
// Generated on 2016-10-28 using generator-jhipster 3.10.0
// Generated on 2016-11-14 using generator-jhipster 3.10.0
'use strict';
var gulp = require('gulp'),

65
pom.xml
View File

@ -5,7 +5,7 @@
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>1.4.1.RELEASE</version>
<version>1.4.2.RELEASE</version>
<relativePath/>
</parent>
@ -37,17 +37,17 @@
<liquibase.version>3.4.2</liquibase.version>
<liquibase-slf4j.version>2.0.0</liquibase-slf4j.version>
<liquibase-hibernate4.version>3.5</liquibase-hibernate4.version>
<mapstruct.version>1.0.0.Final</mapstruct.version>
<mapstruct.version>1.1.0.CR2</mapstruct.version>
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
<maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
<sortpom-maven-plugin.version>2.5.0</sortpom-maven-plugin.version>
<metrics-spark-reporter.version>1.2</metrics-spark-reporter.version>
<metrics-spring.version>3.1.3</metrics-spring.version>
<logstash-logback-encoder.version>4.7</logstash-logback-encoder.version>
<run.addResources>false</run.addResources>
<spring-security.version>4.1.3.RELEASE</spring-security.version>
<springfox.version>2.5.0</springfox.version>
<springfox.version>2.6.1</springfox.version>
<!-- Sonar properties -->
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
<sonar-maven-plugin.version>3.2</sonar-maven-plugin.version>
@ -367,12 +367,6 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-data</artifactId>
</dependency>
<!-- reporting -->
<dependency>
<groupId>fr.ippon.spark.metrics</groupId>
<artifactId>metrics-spark-reporter</artifactId>
<version>${metrics-spark-reporter.version}</version>
</dependency>
<!-- jhipster-needle-maven-add-dependency -->
</dependencies>
<build>
@ -417,6 +411,20 @@
<simulationClass>*</simulationClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
@ -531,39 +539,6 @@
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.2.4</version>
<configuration>
<defaultOutputDirectory>
${project.build.directory}/generated-sources
</defaultOutputDirectory>
<processors>
<processor>org.mapstruct.ap.MappingProcessor</processor>
</processors>
<options>
<mapstruct.suppressGeneratorTimestamp>true</mapstruct.suppressGeneratorTimestamp>
<mapstruct.defaultComponentModel>spring</mapstruct.defaultComponentModel>
</options>
</configuration>
<executions>
<execution>
<id>process</id>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
@ -763,8 +738,8 @@
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v4.6.0</nodeVersion>
<npmVersion>3.10.8</npmVersion>
<nodeVersion>v6.9.1</nodeVersion>
<npmVersion>3.10.9</npmVersion>
</configuration>
</execution>
<execution>

View File

@ -6,7 +6,7 @@ import org.springframework.boot.web.support.SpringBootServletInitializer;
/**
* This is a helper Java class that provides an alternative to creating a web.xml.
* This will be invoked only when the application is deployed to a servlet container like Tomcat, Jboss etc.
* This will be invoked only when the application is deployed to a servlet container like Tomcat, JBoss etc.
*/
public class ApplicationWebXml extends SpringBootServletInitializer {

View File

@ -0,0 +1,17 @@
package io.github.jhipster.sample.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
public class DateTimeFormatConfiguration extends WebMvcConfigurerAdapter {
@Override
public void addFormatters(FormatterRegistry registry) {
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(registry);
}
}

View File

@ -148,6 +148,8 @@ public class JHipsterProperties {
private String from = "jhipsterSampleApplication@localhost";
private String baseUrl = "";
public String getFrom() {
return from;
}
@ -155,6 +157,14 @@ public class JHipsterProperties {
public void setFrom(String from) {
this.from = from;
}
public String getBaseUrl() {
return baseUrl;
}
public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}
}
public static class Security {
@ -277,8 +287,6 @@ public class JHipsterProperties {
private final Jmx jmx = new Jmx();
private final Spark spark = new Spark();
private final Graphite graphite = new Graphite();
private final Logs logs = new Logs();
@ -287,10 +295,6 @@ public class JHipsterProperties {
return jmx;
}
public Spark getSpark() {
return spark;
}
public Graphite getGraphite() {
return graphite;
}
@ -312,39 +316,6 @@ public class JHipsterProperties {
}
}
public static class Spark {
private boolean enabled = false;
private String host = "localhost";
private int port = 9999;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
}
public static class Graphite {
private boolean enabled = false;

View File

@ -12,7 +12,6 @@ import com.ryantenney.metrics.spring.config.annotation.EnableMetrics;
import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter;
import com.zaxxer.hikari.HikariDataSource;
import fr.ippon.spark.metrics.SparkReporter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -118,31 +117,4 @@ public class MetricsConfiguration extends MetricsConfigurerAdapter {
}
}
@Configuration
@ConditionalOnClass(SparkReporter.class)
public static class SparkRegistry {
private final Logger log = LoggerFactory.getLogger(SparkRegistry.class);
@Inject
private MetricRegistry metricRegistry;
@Inject
private JHipsterProperties jHipsterProperties;
@PostConstruct
private void init() {
if (jHipsterProperties.getMetrics().getSpark().isEnabled()) {
log.info("Initializing Metrics Spark reporting");
String sparkHost = jHipsterProperties.getMetrics().getSpark().getHost();
Integer sparkPort = jHipsterProperties.getMetrics().getSpark().getPort();
SparkReporter sparkReporter = SparkReporter.forRegistry(metricRegistry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS)
.build(sparkHost, sparkPort);
sparkReporter.start(1, TimeUnit.MINUTES);
}
}
}
}

View File

@ -6,13 +6,13 @@ import com.fasterxml.classmate.TypeResolver;
import com.google.common.base.Function;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.Order;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;
import springfox.documentation.schema.ModelReference;
import springfox.documentation.schema.TypeNameExtractor;
import springfox.documentation.service.Parameter;
import springfox.documentation.service.ResolvedMethodParameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.schema.contexts.ModelContext;
import springfox.documentation.spi.service.ParameterBuilderPlugin;
@ -45,7 +45,7 @@ public class PageableParameterBuilderPlugin implements ParameterBuilderPlugin {
private Function<ResolvedType, ? extends ModelReference>
createModelRefFactory(ParameterContext context) {
ModelContext modelContext = inputParam(context.methodParameter().getParameterType(),
ModelContext modelContext = inputParam(context.resolvedMethodParameter().getParameterType(),
context.getDocumentationType(),
context.getAlternateTypeProvider(),
context.getGenericNamingStrategy(),
@ -55,8 +55,8 @@ public class PageableParameterBuilderPlugin implements ParameterBuilderPlugin {
@Override
public void apply(ParameterContext context) {
MethodParameter parameter = context.methodParameter();
Class<?> type = parameter.getParameterType();
ResolvedMethodParameter parameter = context.resolvedMethodParameter();
Class<?> type = parameter.getParameterType().getErasedType();
if (type != null && Pageable.class.isAssignableFrom(type)) {
Function<ResolvedType, ? extends ModelReference> factory =
createModelRefFactory(context);

View File

@ -3,12 +3,9 @@ package io.github.jhipster.sample.config.apidoc;
import io.github.jhipster.sample.config.Constants;
import io.github.jhipster.sample.config.JHipsterProperties;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.*;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StopWatch;
import springfox.documentation.service.ApiInfo;
@ -65,10 +62,6 @@ public class SwaggerConfiguration {
.apiInfo(apiInfo)
.forCodeGeneration(true)
.genericModelSubstitutes(ResponseEntity.class)
.ignoredParameterTypes(java.sql.Date.class)
.directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
.directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
.directModelSubstitute(java.time.LocalDateTime.class, Date.class)
.select()
.paths(regex(DEFAULT_INCLUDE_PATTERN))
.build();

View File

@ -31,6 +31,7 @@ public class MailService {
private final Logger log = LoggerFactory.getLogger(MailService.class);
private static final String USER = "user";
private static final String BASE_URL = "baseUrl";
@Inject

View File

@ -2,6 +2,7 @@ package io.github.jhipster.sample.web.rest;
import com.codahale.metrics.annotation.Timed;
import io.github.jhipster.sample.config.JHipsterProperties;
import io.github.jhipster.sample.domain.PersistentToken;
import io.github.jhipster.sample.domain.User;
import io.github.jhipster.sample.repository.PersistentTokenRepository;
@ -39,6 +40,9 @@ public class AccountResource {
private final Logger log = LoggerFactory.getLogger(AccountResource.class);
@Inject
private JHipsterProperties jHipsterProperties;
@Inject
private UserRepository userRepository;
@ -71,15 +75,21 @@ public class AccountResource {
.orElseGet(() -> userRepository.findOneByEmail(managedUserVM.getEmail())
.map(user -> new ResponseEntity<>("e-mail address already in use", textPlainHeaders, HttpStatus.BAD_REQUEST))
.orElseGet(() -> {
User user = userService.createUser(managedUserVM.getLogin(), managedUserVM.getPassword(),
managedUserVM.getFirstName(), managedUserVM.getLastName(), managedUserVM.getEmail().toLowerCase(),
managedUserVM.getLangKey());
String baseUrl = request.getScheme() + // "http"
"://" + // "://"
request.getServerName() + // "myhost"
":" + // ":"
request.getServerPort() + // "80"
request.getContextPath(); // "/myContextPath" or "" if deployed in root context
User user = userService
.createUser(managedUserVM.getLogin(), managedUserVM.getPassword(),
managedUserVM.getFirstName(), managedUserVM.getLastName(),
managedUserVM.getEmail().toLowerCase(), managedUserVM.getLangKey());
String baseUrl = jHipsterProperties.getMail().getBaseUrl();
if (baseUrl.equals("")) {
baseUrl = request.getScheme() + // "http"
"://" + // "://"
request.getServerName() + // "myhost"
":" + // ":"
request.getServerPort() + // "80"
request.getContextPath(); // "/myContextPath" or "" if deployed in root context
}
mailService.sendActivationEmail(user, baseUrl);
return new ResponseEntity<>(HttpStatus.CREATED);

View File

@ -7,7 +7,6 @@ import io.github.jhipster.sample.web.rest.util.PaginationUtil;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpHeaders;
@ -57,8 +56,8 @@ public class AuditResource {
@GetMapping(params = {"fromDate", "toDate"})
public ResponseEntity<List<AuditEvent>> getByDates(
@RequestParam(value = "fromDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate fromDate,
@RequestParam(value = "toDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate toDate,
@RequestParam(value = "fromDate") LocalDate fromDate,
@RequestParam(value = "toDate") LocalDate toDate,
Pageable pageable) throws URISyntaxException {
Page<AuditEvent> page = auditEventService.findByDates(fromDate.atTime(0, 0), toDate.atTime(23, 59), pageable);

View File

@ -6,7 +6,6 @@ import java.util.Set;
import io.github.jhipster.sample.domain.User;
import io.github.jhipster.sample.service.dto.UserDTO;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**

View File

@ -70,12 +70,9 @@ jhipster:
key: 5c37379956bd1242f5636c8cb322c2966ad81277
mail: # specific JHipster mail property, for standard properties see MailProperties
from: jhipsterSampleApplication@localhost
baseUrl: # keep empty to use the server's default URL
metrics: # DropWizard Metrics configuration, used by MetricsConfiguration
jmx.enabled: true
spark:
enabled: false
host: localhost
port: 9999
graphite:
enabled: false
host: localhost

View File

@ -73,12 +73,9 @@ jhipster:
key: 5c37379956bd1242f5636c8cb322c2966ad81277
mail: # specific JHipster mail property, for standard properties see MailProperties
from: jhipsterSampleApplication@localhost
baseUrl: # keep empty to use the server's default URL
metrics: # DropWizard Metrics configuration, used by MetricsConfiguration
jmx.enabled: true
spark:
enabled: false
host: localhost
port: 9999
graphite:
enabled: false
host: localhost

View File

@ -78,5 +78,5 @@ jhipster:
license:
licenseUrl:
ribbon:
# comma seperated list of profiles to show a ribbon on the GUI
# comma separated list of profiles to show a ribbon on the GUI
displayOnActiveProfiles: dev

View File

@ -47,10 +47,10 @@
_force += 2 * p.length + ((p.length >= 10) ? 1 : 0);
_force += _passedMatches * 10;
// penality (short password)
// penalty (short password)
_force = (p.length <= 6) ? Math.min(_force, 10) : _force;
// penality (poor variety of characters)
// penalty (poor variety of characters)
_force = (_passedMatches === 1) ? Math.min(_force, 10) : _force;
_force = (_passedMatches === 2) ? Math.min(_force, 20) : _force;
_force = (_passedMatches === 3) ? Math.min(_force, 40) : _force;

View File

@ -15,7 +15,7 @@
function get(name) {
if (LANGUAGES.indexOf($cookies.getObject(name)) === -1) {
$log.info('Resetting invalid cookie language "' + $cookies.getObject(name) + '" to prefered language "en"');
$log.info('Resetting invalid cookie language "' + $cookies.getObject(name) + '" to preferred language "en"');
$cookies.putObject(name, 'en');
}
return $cookies.getObject(name);

View File

@ -27,7 +27,7 @@
}
// update the window title using params in the following
// precendence
// precedence
// 1. titleKey parameter
// 2. $state.$current.data.pageTitle (current state page title)
// 3. 'global.title'

View File

@ -49,7 +49,7 @@
$rootScope.$broadcast('authenticationSuccess');
// previousState was set in the authExpiredInterceptor before being redirected to login modal.
// since login is succesful, go to stored previousState and clear previousState
// since login is successful, go to stored previousState and clear previousState
if (Auth.getPreviousState()) {
var previousState = Auth.getPreviousState();
Auth.resetPreviousState();

View File

@ -1,30 +0,0 @@
(function() {
'use strict';
angular
.module('jhipsterSampleApplicationApp')
.directive('activeLink', activeLink);
function activeLink() {
var directive = {
restrict: 'A',
link: linkFunc
};
return directive;
function linkFunc(scope, element, attrs) {
var clazz = attrs.activeLink;
var path = attrs.href;
path = path.substring(1); //hack because path does bot return including hashbang
scope.location = location;
scope.$watch('location.path()', function(newPath) {
if (path === newPath) {
element.addClass(clazz);
} else {
element.removeClass(clazz);
}
});
}
}
})();

View File

@ -12,7 +12,7 @@ Hide ng-cloak on page load, https://docs.angularjs.org/api/ng/directive/ngCloak
}
/* ==========================================================================
Developement Ribbon
Development Ribbon
========================================================================== */
.ribbon {
background-color: #a00;
@ -278,7 +278,7 @@ entity tables helpers
}
.jh-table > tbody > tr > td {
/* Align text in td verifically (top aligned by Bootstrap) */
/* Align text in td vertically (top aligned by Bootstrap) */
vertical-align: middle;
}

View File

@ -90,7 +90,6 @@
<script src="app/services/auth/account.service.js"></script>
<script src="app/layouts/navbar/navbar.controller.js"></script>
<script src="app/layouts/navbar/active-menu.directive.js"></script>
<script src="app/layouts/navbar/active-link.directive.js"></script>
<script src="app/layouts/error/error.state.js"></script>
<script src="app/home/home.state.js"></script>
<script src="app/home/home.controller.js"></script>

View File

@ -1,6 +1,7 @@
package io.github.jhipster.sample.web.rest;
import io.github.jhipster.sample.JhipsterSampleApplicationApp;
import io.github.jhipster.sample.config.JHipsterProperties;
import io.github.jhipster.sample.domain.Authority;
import io.github.jhipster.sample.domain.User;
import io.github.jhipster.sample.repository.AuthorityRepository;
@ -44,6 +45,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@SpringBootTest(classes = JhipsterSampleApplicationApp.class)
public class AccountResourceIntTest {
@Inject
private JHipsterProperties jHipsterProperties;
@Inject
private UserRepository userRepository;
@ -69,6 +73,7 @@ public class AccountResourceIntTest {
doNothing().when(mockMailService).sendActivationEmail((User) anyObject(), anyString());
AccountResource accountResource = new AccountResource();
ReflectionTestUtils.setField(accountResource, "jHipsterProperties", jHipsterProperties);
ReflectionTestUtils.setField(accountResource, "userRepository", userRepository);
ReflectionTestUtils.setField(accountResource, "userService", userService);
ReflectionTestUtils.setField(accountResource, "mailService", mockMailService);

View File

@ -12,6 +12,7 @@ import org.mockito.MockitoAnnotations;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.context.junit4.SpringRunner;
@ -49,6 +50,9 @@ public class AuditResourceIntTest {
@Inject
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
@Inject
private FormattingConversionService formattingConversionService;
@Inject
private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
@ -64,6 +68,7 @@ public class AuditResourceIntTest {
AuditResource auditResource = new AuditResource(auditEventService);
this.restAuditMockMvc = MockMvcBuilders.standaloneSetup(auditResource)
.setCustomArgumentResolvers(pageableArgumentResolver)
.setConversionService(formattingConversionService)
.setMessageConverters(jacksonMessageConverter).build();
}