前回の質問の派生です。
回答者様の答えを参考に
DBとの接続設定とビルド実行ができました。
ので次はdomaの機能を使い
entityやdaoを自動生成しようと思います。
build.gradleに以下を記述しましたが
エラーがでてビルドできておりません。
原因がわかる方、よろしくお願いします
}
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-wtp' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'war' group = 'sample' version = 'sample' sourceCompatibility = 8 repositories { mavenCentral() } configurations { providedRuntime } dependencies { implementation('org.springframework.boot:spring-boot-starter-security') implementation('org.springframework.boot:spring-boot-starter-thymeleaf') implementation('org.springframework.boot:spring-boot-starter-web') implementation( 'org.springframework.boot:spring-boot-starter-data-jpa') runtimeOnly('org.postgresql:postgresql') providedRuntime('org.springframework.boot:spring-boot-starter-tomcat') testImplementation('org.springframework.boot:spring-boot-starter-test') testImplementation('org.springframework.security:spring-security-test') annotationProcessor "org.seasar.doma.boot:doma-spring-boot-starter:1.1.1" compile("org.seasar.doma.boot:doma-spring-boot-starter:1.1.1"){ exclude group: "org.springframework.boot" } } configurations { domaGenRuntime } repositories { mavenCentral() maven {url 'https://oss.sonatype.org/content/repositories/snapshots/'} } //新しく追加した箇所 dependencies { domaGenRuntime 'org.seasar.doma:doma-gen:2.21.0' domaGenRuntime 'org.postgresql:org.postgresql.Driver' } //新しく追加した箇所 task gen << { ant.taskdef(resource: 'domagentask.properties', classpath: configurations.domaGenRuntime.asPath) ant.gen(url: 'jdbc:postgresql://postgres.aws.com:5432/sample', user:postgres '', password:postgres '') { entityConfig() daoConfig() sqlConfig() } } }
コンソール
* What went wrong: Could not compile build file 'C:\pleiades\workspace\sample\build.gradle'. > startup failed: build file 'C:\pleiades\workspace\sample\build.gradle': 61: expecting EOF, found 'gen' @ line 61, column 6. task gen << { ^ 1 error * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org CONFIGURE FAILED in 0s

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/25 13:39