Skip to content

Commit

Permalink
Merge pull request #3 from jhipster/master
Browse files Browse the repository at this point in the history
Update fork
  • Loading branch information
pmverma authored May 22, 2019
2 parents 5b95f1f + 75dfd62 commit dc4b665
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 17 deletions.
2 changes: 2 additions & 0 deletions generators/ci-cd/templates/.gitlab-ci.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ gradle-package:
artifacts:
paths:
- build/libs/*.jar
- build/classes
expire_in: 1 day

# Uncomment the following line to use gitlabs container registry. You need to adapt the REGISTRY_URL in case you are not using gitlab.com
Expand Down Expand Up @@ -208,6 +209,7 @@ maven-package:
artifacts:
paths:
- target/*.jar
- target/classes
expire_in: 1 day

# Uncomment the following line to use gitlabs container registry. You need to adapt the REGISTRY_URL in case you are not using gitlab.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
loadColumnType = 'string';
} else if (columnType === 'blob' || columnType === 'longblob') {
loadColumnType = 'blob';
} else if (columnType === 'clob') {
} else if (columnType === '${clobType}') {
loadColumnType = 'clob';
}
_%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ for (lineNb = 1; lineNb <= numberOfRows; lineNb++) {
for (idx in fields) {
let data = '';
let columnType = fields[idx].columnType;
let fieldType = fields[idx].fieldType;
if (columnType === 'integer'
|| columnType === 'bigint'
|| columnType === 'double'
Expand Down Expand Up @@ -135,9 +134,9 @@ for (lineNb = 1; lineNb <= numberOfRows; lineNb++) {
data = '';
}
}
if (fieldType === 'byte[]' && fields[idx].fieldTypeBlobContent !== 'text') {
if (columnType === 'blob' || columnType === 'longblob') {
data = '../data/blob/hipster.png'
} else if (fieldType === 'byte[]' && fields[idx].fieldTypeBlobContent === 'text'){
} else if (columnType === '${clobType}'){
data = '../data/blob/hipster.txt'
}
Expand Down Expand Up @@ -184,7 +183,7 @@ for (lineNb = 1; lineNb <= numberOfRows; lineNb++) {
}
line.push(data);
if (fieldType === 'byte[]' && fields[idx].fieldTypeBlobContent !== 'text') {
if (columnType === 'blob' || columnType === 'longblob') {
line.push('image/png');
}
}
Expand Down
2 changes: 1 addition & 1 deletion generators/generator-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

// version of docker images
const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v5.0.0';
const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v5.0.1';
const DOCKER_JAVA_JRE = 'adoptopenjdk/openjdk11:alpine-jre';
const DOCKER_MYSQL = 'mysql:8.0.16';
const DOCKER_MARIADB = 'mariadb:10.4.4';
Expand Down
3 changes: 3 additions & 0 deletions generators/server/templates/gradle/sonar.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jacoco {
}

jacocoTestReport {
executionData tasks.withType(Test)
classDirectories = files(sourceSets.main.output.classesDirs)
sourceDirectories = files(sourceSets.main.java.srcDirs)
reports {
xml.enabled true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,22 @@ public class ElasticsearchConfiguration {
@Primary
public ElasticsearchOperations elasticsearchTemplate(final JestClient jestClient,
final ElasticsearchConverter elasticsearchConverter,
<%_ if (databaseType !== 'mongodb') { _%>
final SimpleElasticsearchMappingContext simpleElasticsearchMappingContext,
<%_ } _%>
EntityMapper mapper) {
<%_ if (databaseType === 'mongodb') { _%>
CustomElasticsearchMappingContext mappingContext = new CustomElasticsearchMappingContext();
<%_ } _%>
return new JestElasticsearchTemplate(
jestClient,
<%_ if (databaseType === 'mongodb') { _%>
new MappingElasticsearchConverter(new CustomElasticsearchMappingContext()),
new MappingElasticsearchConverter(mappingContext),
new DefaultJestResultsMapper(mappingContext, mapper));
<%_ } else { _%>
elasticsearchConverter,
<%_ } _%>
new DefaultJestResultsMapper(simpleElasticsearchMappingContext, mapper));
<%_ } _%>
}

public class CustomEntityMapper implements EntityMapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.antMatchers("/management/prometheus").permitAll()
.antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN)<%_ if (authenticationType === 'session') { %>;<% } %>
<%_ if (authenticationType === 'jwt') { _%>
<%_ if (applicationType === 'monolith') { _%>
.and()
.httpBasic()
<%_ } _%>
.and()
.apply(securityConfigurerAdapter());
<%_ } else if (authenticationType === 'oauth2') { _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ openapi: "3.0.1"
info:
title: "<%= baseName %>"
version: 0.0.1
servers:
- url: http://localhost:<%= serverPort %>
description: Developpement server
- url: https://localhost:<%= serverPort %>
description: Developpement server with TLS Profile
paths: {}
<% if(authenticationType === 'jwt') { %>
components:
Expand Down
8 changes: 4 additions & 4 deletions test-integration/scripts/21-tests-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source $(dirname $0)/00-init-env.sh
#-------------------------------------------------------------------------------
cd "$JHI_FOLDER_APP"
if [ -f "mvnw" ]; then
./mvnw enforcer:display-info
./mvnw -ntp enforcer:display-info
elif [ -f "gradlew" ]; then
./gradlew -v
fi
Expand All @@ -17,7 +17,7 @@ fi
# Check Javadoc generation
#-------------------------------------------------------------------------------
if [ -f "mvnw" ]; then
./mvnw javadoc:javadoc
./mvnw -ntp javadoc:javadoc
elif [ -f "gradlew" ]; then
./gradlew javadoc
fi
Expand All @@ -27,15 +27,15 @@ fi
#-------------------------------------------------------------------------------
if [[ "$JHI_APP" == *"uaa"* ]]; then
cd "$JHI_FOLDER_UAA"
./mvnw verify
./mvnw -ntp verify
fi

#-------------------------------------------------------------------------------
# Launch tests
#-------------------------------------------------------------------------------
cd "$JHI_FOLDER_APP"
if [ -f "mvnw" ]; then
./mvnw verify \
./mvnw -ntp verify \
-Dlogging.level.ROOT=OFF \
-Dlogging.level.org.zalando=OFF \
-Dlogging.level.io.github.jhipster=OFF \
Expand Down
6 changes: 3 additions & 3 deletions test-integration/scripts/23-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source $(dirname $0)/00-init-env.sh
#-------------------------------------------------------------------------------
if [[ "$JHI_APP" == *"uaa"* ]]; then
cd "$JHI_FOLDER_UAA"
./mvnw verify -DskipTests -Pdev
./mvnw -ntp verify -DskipTests -Pdev
mv target/*.jar app.jar
fi

Expand All @@ -26,7 +26,7 @@ fi
# Package the application
#-------------------------------------------------------------------------------
if [ -f "mvnw" ]; then
./mvnw verify -DskipTests -P"$JHI_PROFILE"
./mvnw -ntp verify -DskipTests -P"$JHI_PROFILE"
mv target/*.jar app.jar
elif [ -f "gradlew" ]; then
./gradlew bootJar -P"$JHI_PROFILE" -x test
Expand All @@ -45,7 +45,7 @@ fi
#-------------------------------------------------------------------------------
if [ "$JHI_WAR" == 1 ]; then
if [ -f "mvnw" ]; then
./mvnw verify -DskipTests -P"$JHI_PROFILE",war
./mvnw -ntp verify -DskipTests -P"$JHI_PROFILE",war
mv target/*.war app.war
elif [ -f "gradlew" ]; then
./gradlew bootWar -P"$JHI_PROFILE" -Pwar -x test
Expand Down
4 changes: 2 additions & 2 deletions test-integration/scripts/25-sonar-analyze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ cd "$JHI_FOLDER_APP"

if [[ "$JHI_APP" = "ngx-default" && "$TRAVIS_REPO_SLUG" = "jhipster/generator-jhipster" && "$TRAVIS_BRANCH" = "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then
echo "*** Sonar analyze for master branch"
./mvnw initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \
./mvnw -ntp initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.projectKey=io.github.jhipster.sample:jhipster-sample-application \
-Dsonar.login=$SONAR_TOKEN

elif [[ $JHI_SONAR = 1 ]]; then
echo "*** Sonar analyze locally"
./mvnw initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \
./mvnw -ntp initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \
-Dsonar.host.url=http://localhost:9001 \
-Dsonar.projectKey=JHipsterSonar

Expand Down

0 comments on commit dc4b665

Please sign in to comment.