Skip to content

Instantly share code, notes, and snippets.

@h1romas4
Last active December 22, 2017 13:09
Show Gist options
  • Save h1romas4/59dfc6f5b0b530e0ac6706cebcd19db6 to your computer and use it in GitHub Desktop.
Save h1romas4/59dfc6f5b0b530e0ac6706cebcd19db6 to your computer and use it in GitHub Desktop.
Visual Studio Code / Eclipse / Intellij Idea 用 Java プロジェクト build.gradle (Spring Loaded 対応)
buildscript {
dependencies {
// for live reloaded
// classpath 'org.springframework:springloaded:1.2.6.RELEASE'
}
}
plugins {
id 'java'
id 'eclipse'
id 'org.springframework.boot' version '1.5.9.RELEASE'
}
eclipse {
classpath {
defaultOutputDir = file('build/classes/java/main')
}
}
idea {
module {
inheritOutputDirs = false
outputDir = file("$buildDir/classes/java/main")
}
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
def defaultEncoding = 'UTF-8'
[compileJava, compileTestJava]*.options*.encoding = defaultEncoding
repositories {
jcenter()
}
bootRun {
addResources = true
}
ext['thymeleaf.version'] = '3.0.2.RELEASE'
ext['thymeleaf-layout-dialect.version'] = '2.1.1'
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.thymeleaf:thymeleaf-spring4')
compile("org.springframework.boot:spring-boot-devtools")
runtime('com.h2database:h2:1.4.196')
}
/*
application.yml
spring:
profiles:
active: devel
thymeleaf:
mode: HTML
messages:
basename: messages
encoding: UTF-8
doma:
dialect: POSTGRES
server:
contextPath: /
compression:
enabled: true
mime-types:
- text/css
- text/html
- application/javascript
- application/json
---
spring:
profiles: devel
devtools:
restart:
enabled: true
datasource:
url: jdbc:h2:mem:example;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=TRUE;MODE=PostgreSQL
driverClassName: org.h2.Driver
username: sa
password:
h2:
console:
# see http://localhost:8080/h2-console
enabled: true
server:
port: 8080
setting:
siteUrl: http://localhost:8080/
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment