Spring Boot/Doma/開発/ビルド

build.gradle

大体このように記述するとよい

buildscript {
    ext {
        springBootVersion = '2.1.1.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}
 
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
 
group = 'com.example'
version = '20181226'
sourceCompatibility = 1.8
 
repositories {
    mavenCentral()
}
 
 
// ここが DOMA のコンパイルに関わるところ
// resources のコピーを compile よりも明示的に先にする。
processResources.destinationDir = compileJava.destinationDir
compileJava.dependsOn processResources
 
 
repositories {
    mavenCentral()
}
 
 
dependencies {
    // DOMA のアノテーションによるコード自動生成に関わるところ
    // 自動設定で読み込まれるのだが、これは自動生成を駆動するための記述
    compile "org.seasar.doma:doma:2.16.1"
    annotationProcessor "org.seasar.doma:doma:2.16.1"
    //中略
    // DOMA の Spring Boot 用自動設定
    implementation group: 'org.seasar.doma.boot', name: 'doma-spring-boot-starter', version: '1.1.1'
    runtimeOnly('mysql:mysql-connector-java')
}
java/spring/spring_boot/doma/dev/build.txt · 最終更新: 2018-12-26 19:13 by ore