Skip to content

Instantly share code, notes, and snippets.

@h1romas4
Last active August 3, 2017 07:43
Show Gist options
  • Save h1romas4/46edae0448d370338959a242da6f204a to your computer and use it in GitHub Desktop.
Save h1romas4/46edae0448d370338959a242da6f204a to your computer and use it in GitHub Desktop.
Groovy + SpringBoot +Thymeleaf + Doma2 + H2 の build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.6.RELEASE")
}
}
apply plugin: 'groovy'
apply plugin: 'org.springframework.boot'
repositories {
jcenter()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.12'
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-devtools"
compile "org.thymeleaf:thymeleaf-spring4"
compile "org.seasar.doma.boot:doma-spring-boot-starter:1.1.1"
runtime "com.h2database:h2:1.4.196"
}
/*
File Layout
└─src
└─main
├─groovy
│ └─net
│ └─maple4ever
│ └─sample
└─resources
└─templates
*/
/**
application.yml
spring.datasource.url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=TRUE
spring.datasource.driverClassName: org.h2.Driver
spring.datasource.username: sa
spring.datasource.password:
spring.h2.console.enabled: true
*/
/**
package hello;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment