Skip to content

Commit

Permalink
tweak dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
baixiac committed Apr 30, 2021
1 parent 8cb7372 commit 59cadf4
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 23 deletions.
57 changes: 54 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.gradle.internal.os.OperatingSystem
import java.util.concurrent.TimeUnit

buildscript {
repositories {
Expand All @@ -14,7 +15,7 @@ buildscript {
plugins {
id 'org.springframework.boot' version "${spring_boot_version}"
id "com.moowork.node" version "1.2.0"
id "io.spring.dependency-management" version "1.0.7.RELEASE"
id "io.spring.dependency-management" version "1.0.10.RELEASE"
id 'de.undercouch.download' version '4.1.1' apply false
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
}
Expand Down Expand Up @@ -174,7 +175,7 @@ dependencies {
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: findbugAnnotationVersion
implementation "org.hibernate:hibernate-envers:${hibernate_version}"
implementation "org.hibernate:hibernate-validator:6.2.0.Final"
implementation("org.liquibase:liquibase-core")
implementation("org.liquibase:liquibase-core:${liquibase_version}")
implementation "com.mattbertolini:liquibase-slf4j:${liquibase_slf4j_version}"
implementation "org.springframework.boot:spring-boot-actuator"
implementation "org.springframework.boot:spring-boot-autoconfigure"
Expand All @@ -186,7 +187,7 @@ dependencies {
exclude group: 'org.hibernate', module: 'hibernate-entitymanager'
}
implementation "org.springframework.boot:spring-boot-starter-security"
implementation("org.springframework.cloud:spring-cloud-starter-netflix-zuul:${zuul_proxy_version}")
implementation("org.springframework.cloud:spring-cloud-starter-netflix-zuul")
implementation "org.springframework.cloud:spring-cloud-context"
implementation "org.springframework.cloud:spring-cloud-commons"
implementation("org.springframework.boot:spring-boot-starter-web") {
Expand All @@ -203,6 +204,7 @@ dependencies {
}
implementation "org.springframework.security:spring-security-jwt:${spring_security_jwt_versions}"
implementation "org.springframework.security.oauth:spring-security-oauth2:${spring_security_oauth2_version}"
implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:${spring_security_oauth2_version}"
implementation("io.springfox:springfox-swagger2:${springfox_version}") {
exclude module: 'mapstruct'
}
Expand Down Expand Up @@ -231,6 +233,12 @@ dependencies {
annotationProcessor group: 'org.springframework.boot', name: 'spring-boot-configuration-processor'
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Hoxton.SR9"
}
}

clean {
delete "target"
}
Expand Down Expand Up @@ -286,3 +294,46 @@ nexusPublishing {
}
}
}

class TimingsListener implements TaskExecutionListener, BuildListener {
private long startTime
private timings = []

@Override
void beforeExecute(Task task) {
startTime = System.nanoTime()
}

@Override
void afterExecute(Task task, TaskState taskState) {
def ms = TimeUnit.MILLISECONDS.convert(System.nanoTime() - startTime, TimeUnit.NANOSECONDS);
timings.add([ms, task.path])
task.project.logger.warn "${task.path} took ${ms}ms"
}

@Override
void buildFinished(BuildResult result) {
println "Task timings:"
for (timing in timings) {
if (timing[0] >= 50) {
printf "%7sms %s\n", timing
}
}
}

@Override
void buildStarted(Gradle gradle) {}

@Override
void projectsEvaluated(Gradle gradle) {}

@Override
void projectsLoaded(Gradle gradle) {}

@Override
void settingsEvaluated(Settings settings) {}
}
if (project.hasProperty('dev')) {
gradle.addListener new TimingsListener()
}

15 changes: 7 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@ json_path_version=0.9.1
jhipster_server_version=1.1.2
hazelcast_hibernate52_version=1.2
hibernate_version=5.2.12.Final
hikaricp_version=2.7.4
liquibase_slf4j_version=2.0.0
liquibase_hibernate5_version=3.6
hikaricp_version=3.4.5
liquibase_slf4j_version=4.0.0
liquibase_version=4.3.0
metrics_spring_version=3.1.3
node_version=6.10.0
npm_version=4.3.0
prometheus_simpleclient_version=0.0.20
postgresql_version=42.2.14
spring_security_jwt_versions=1.0.9.RELEASE
spring_security_oauth2_version=2.3.5.RELEASE
spring_security_jwt_versions=1.1.1.RELEASE
spring_security_oauth2_version=2.3.8.RELEASE
springfox_version=2.6.1
spring_boot_version=2.3.10.RELEASE
spring_boot_version=2.3.7.RELEASE
gatling_version=3.3.1
mapstruct_version=1.1.0.Final
undertow_version=1.4.10.Final
yarn_version=0.21.3
zuul_proxy_version=2.2.8.RELEASE
spring_data_envers_version=2.3.9.RELEASE
spring_data_envers_version=2.0.4.RELEASE
jackson_version=2.9.10
jackson_dataformat_version=2.9.10
javaxXmlBindVersion=2.3.3
Expand Down
2 changes: 1 addition & 1 deletion gradle/liquibase.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ configurations {
}

dependencies {
liquibase "org.liquibase.ext:liquibase-hibernate5:${liquibase_hibernate5_version}"
liquibase "org.liquibase.ext:liquibase-hibernate5:${liquibase_version}"
}

if (OperatingSystem.current().isWindows()) {
Expand Down
2 changes: 2 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
org.gradle.caching=true
org.gradle.parallel=true
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* This class captures the response from ManagementPortal's /oauth/token endpoint. The actual access
* token can be retrieved with the {@link #getAccessToken()} method. This is a token in JWT format,
* and can be parsed with a JWT library of your preference. You can ise {@link #isValid()} to check
* and can be parsed with a JWT library of your preference. You can use {@link #isValid()} to check
* if you got a valid token, or an error response. If {@link #isValid()} returns <code>false</code>,
* you can use {@link #getError()} and {@link #getErrorDescription()} to find the error message
* that was returned by ManagementPortal. You can also use {@link #isExpired()} to find out if the
Expand Down
2 changes: 2 additions & 0 deletions src/main/docker/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ services:
- POSTGRES_USER=radarbase
- POSTGRES_PASSWORD=radarbase
- POSTGRES_DB=managementportal
ports:
- 5432:5432
21 changes: 12 additions & 9 deletions src/main/resources/config/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ spring:
serialization.indent_output: true
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:h2:mem:managementportal;DB_CLOSE_DELAY=-1
# driverClassName: org.postgresql.Driver
# url: jdbc:postgresql://localhost:5432/managementportal
username: ManagementPortal
password:
# url: jdbc:h2:mem:managementportal;DB_CLOSE_DELAY=-1
driverClassName: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/managementportal
# username: ManagementPortal
# password:
username: radarbase
password: radarbase
h2:
console:
enabled: false
jpa:
database-platform: io.github.jhipster.domain.util.FixedH2Dialect
# database-platform: org.hibernate.dialect.PostgreSQLDialect
database: H2
# database: POSTGRESQL
# database-platform: org.hibernate.dialect.H2Dialect
database-platform: org.hibernate.dialect.PostgreSQLDialect
# database: H2
database: POSTGRESQL
show-sql: true
properties:
hibernate.id.new_generator_mappings: true
Expand All @@ -49,6 +51,7 @@ spring:
hibernate.cache.hazelcast.instance_name: ManagementPortal
hibernate.cache.use_minimal_puts: true
hibernate.cache.hazelcast.use_lite_member: true
hibernate.ddl-auto: none
mail:
host: # for hotmail
port:
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ spring:
audit_strategy_validity_store_revend_timestamp: true
global_with_modified_flag: true
track_entities_changed_in_revision: true
hibernate:
jdbc:
lob:
non_contextual_creation: true
messages:
basename: i18n/messages
mvc:
Expand Down
5 changes: 4 additions & 1 deletion src/test/bash/run-prod-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ set -e
echo "Running production e2e tests"
cp src/test/resources/config/keystore.p12 src/main/docker/etc/config
cp src/test/resources/config/keystore.p12 src/main/resources/config
sed -i .bak "s|contexts: prod|contexts: dev|" src/main/resources/config/application-prod.yml # set liquibase context to dev so it loads demo data and back the original at src/main/resources/config/application-prod.yml.bak

# set liquibase context to dev so it loads demo data
sed -i "" "s|contexts: prod|contexts: dev|" src/main/resources/config/application-prod.yml
./gradlew -Pprod buildDocker -x test -x javadocJar
# recover the prod liquibase context
git checkout src/main/resources/config/application-prod.yml

docker-compose -f src/main/docker/app.yml up -d # spin up production mode application
Expand Down

0 comments on commit 59cadf4

Please sign in to comment.