質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Spring Boot

Spring Bootは、Javaのフレームワークの一つ。Springプロジェクトが提供する様々なフレームワークを統合した、アプリケーションを高速で開発するために設計されたフレームワークです。

Q&A

解決済

1回答

2804閲覧

spring boot domaでファイル自動生成

mk222222

総合スコア59

Spring Boot

Spring Bootは、Javaのフレームワークの一つ。Springプロジェクトが提供する様々なフレームワークを統合した、アプリケーションを高速で開発するために設計されたフレームワークです。

0グッド

0クリップ

投稿2019/01/24 14:27

前回の質問の派生です。

回答者様の答えを参考に
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

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

最後の } が余分なのと, ant.genの引数が誤っていますね。

groovy

1task gen << { 2 ant.taskdef(resource: 'domagentask.properties', classpath: configurations.domaGenRuntime.asPath) 3 ant.gen(url: 'jdbc:postgresql://postgres.aws.com:5432/sample', 4 // Bad!! user:postgres '', password:postgres '' 5 user: 'postgres', password: 'postgres') { 6 entityConfig() 7 daoConfig() 8 sqlConfig() 9 } 10}

投稿2019/01/24 15:47

euledge

総合スコア2404

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

mk222222

2019/01/25 13:39

文法ミス!お恥ずかしい、無事ビルドできました!ありがとうございます! (けどファイル作成されてなかった←)
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問