Abebe123000 / hello-spring-boot

0 stars 0 forks source link

gradle を試す #2

Open Abebe123000 opened 7 months ago

Abebe123000 commented 7 months ago

https://qiita.com/comcha/items/47b55f6fbabd2716dbe1

Abebe123000 commented 7 months ago

docker image https://hub.docker.com/_/gradle

Abebe123000 commented 7 months ago

gradle init で hello world できた

Abebe123000 commented 7 months ago

docker 内で完結しようと思っていたのに gradlew を叩いたらjava がインストールされてしまった

まあいいか

Abebe123000 commented 7 months ago

よく読む http://gradle.monochromeroad.com/docs/userguide/tutorial_java_projects.html

Abebe123000 commented 7 months ago

Spring Boot Gradle プラグインリファレンスガイド https://spring.pleiades.io/spring-boot/docs/3.2.4/gradle-plugin/reference/htmlsingle/

Abebe123000 commented 7 months ago

java のバージョンが合わなくてエラー

Abebe123000 commented 7 months ago

現在のバージョンが Java 11 多分 17以上要求

Abebe123000 commented 7 months ago

gradle の docker の最新が 11 なのが普通にあれ https://hub.docker.com/_/gradle

Abebe123000 commented 7 months ago

この記事と同じ 2.7.8 で行けそう https://qiita.com/studio_meowtoon/items/37ac0082a3228e4de570

Abebe123000 commented 7 months ago

2 系の最新が 2.7.18 かな https://spring.pleiades.io/projects/spring-boot#learn

Abebe123000 commented 7 months ago
./gradlew run

FAILURE: Build failed with an exception.

* Where:
Build file '/home/abebe/projects/java/spring/hello-spring-boot/myApp/build.gradle' line: 17

* What went wrong:
A problem occurred evaluating project ':myApp'.
> Could not find method application() for arguments [build_85kx6w4lc6gexiuas14km5awr$_run_closure1@422fd04e] on project ':myApp' of type org.gradle.api.Project.

* 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.

BUILD FAILED in 606ms
7 actionable tasks: 7 up-to-date

application {} のところが違う?

Abebe123000 commented 7 months ago

最終的に動くようになったけど、以下の問題に直面 https://github.com/gradle/gradle/issues/20455

maven でいいか

Abebe123000 commented 7 months ago

curl -v http://localhost:8080/api/data -w '\n' をやってなかっただけで普通に動いていたかも。

Abebe123000 commented 7 months ago

情報多いしとりあえず maven でやる