Skip to content

Commit

Permalink
Merged in boot2 (pull request #11)
Browse files Browse the repository at this point in the history
Boot2

* Migrate to Spring Boot 2.0

* Finishing up Spring Boot 2.0 upgrade

Approved-by: Dmitriy Kopylenko <dkopylenko@unicon.net>
Approved-by: Jonathan Johnson <jj@scaldingspoon.com>
  • Loading branch information
dima767 authored and Jonathan Johnson committed Mar 15, 2018
1 parent c16d76a commit cb0fa2c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 42 deletions.
55 changes: 24 additions & 31 deletions backend/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.5.7.RELEASE"
}
}

plugins {
id 'java'
id 'groovy'
id 'war'
id 'org.springframework.boot' version '2.0.0.RELEASE'
}

apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -23,24 +15,21 @@ repositories {
mavenCentral()
}

//Integration of the frontend and backend into the build to have all of the UI resources available in the app's jar
jar.dependsOn(':ui:npm_run_buildProd')
jar {
from(tasks.findByPath(':ui:npm_run_buildProd').outputs) {
into 'public'
}
}
jar.baseName = 'shibui'
processResources.dependsOn(':ui:npm_run_buildProd')

war.dependsOn(':ui:npm_run_buildProd')
war {
//Integration of the frontend and backend into the build to have all of the UI resources available in the app's executable war
bootWar.dependsOn(':ui:npm_run_buildProd')
bootWar {
from(tasks.findByPath(':ui:npm_run_buildProd').outputs) {
into '/'
}
archiveName = 'shibui.war'
}
war.baseName = 'shibui'
bootWar.baseName = 'shibui'

springBoot {
mainClassName = 'edu.internet2.tier.shibboleth.admin.ui.ShibbolethUiApplication'
}

dependencies {
// opensaml deps
Expand All @@ -58,13 +47,18 @@ dependencies {
compile "org.hibernate:${it}:${project.'hibernate.version'}"
}

// spring boot plugins
['starter-web', 'starter-actuator', 'starter-data-jpa', 'starter-security', 'devtools'].each {
// spring boot auto-config starters
['starter-web', 'starter-data-jpa', 'starter-security', 'devtools'].each {
compile "org.springframework.boot:spring-boot-${it}"
}
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'

compile "org.liquibase:liquibase-core"
compile group: 'org.jadira.usertype', name: 'usertype.core', version: '6.0.1.GA'

//So it works on Java 9 without explicitly requiring to load that module (needed ny Hibernate)
runtimeOnly 'javax.xml.bind:jaxb-api:2.3.0'

// TODO: these will likely only be runtimeOnly or test scope, unless we want to ship the libraries with the final product
compile "com.h2database:h2"
runtimeOnly "org.postgresql:postgresql"
Expand Down Expand Up @@ -148,14 +142,13 @@ task generateSources {
}
}

compileJava {
dependsOn generateSources
tasks.withType(JavaExec) {
// Assign all Java system properties from
// the command line to the JavaExec task which 'bootRun' task is a subclass of
// so we could pass -Dstyle.system.props=to-bootRun-task
systemProperties System.properties
}

bootRun {
systemProperties = System.properties
compileJava {
dependsOn generateSources
}

bootRepackage {
mainClass = 'edu.internet2.tier.shibboleth.admin.ui.ShibbolethUiApplication'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableScheduling;

Expand Down
11 changes: 2 additions & 9 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,9 @@ spring.h2.console.enabled=true
#spring.datasource.driverClassName=org.mariadb.jdbc.Driver
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect

#Tomcat specific DataSource props. Do we need these?
#spring.datasource.tomcat.maxActive=100
#spring.datasource.tomcat.minIdle=10
#spring.datasource.tomcat.maxIdle=10
#spring.datasource.tomcat.initialSize=50
#spring.datasource.tomcat.validationQuery=select 1

# Liquibase properties
liquibase.enabled=false
#liquibase.change-log=classpath:edu/internet2/tier/shibboleth/admin/ui/database/masterchangelog.xml
spring.liquibase.enabled=false
#spring.liquibase.change-log=classpath:edu/internet2/tier/shibboleth/admin/ui/database/masterchangelog.xml

# Hibernate properties
# for production never ever use create, create-drop. It's BEST to use validate
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ shibboleth.version=3.4.0-SNAPSHOT
opensaml.version=3.4.0-SNAPSHOT
xmltooling.version=1.4.7-SNAPSHOT

spring-boot.version=1.5.6.RELEASE
spring-boot.version=2.0.0.RELEASE

hibernate.version=5.2.11.Final

0 comments on commit cb0fa2c

Please sign in to comment.