0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

javaでgradle project

Last updated at Posted at 2024-11-29

メモです。gradleはRustのcargo、Goのgoみたいな感じです。プロジェクトにbundleされている./gradlewのshellファイルを呼び出しても同じことができます。

また、build.gradlecargo.yamlgo.modのように、依存関係を管理するファイルです。

mkdir hello-gradle-java
gradle init --type java-application
Select build script DSL:
  1: Groovy
  2: Kotlin
Enter selection (default: Groovy) [1..2]

1を選択。

Select test framework:
  1: JUnit 4
  2: TestNG
  3: Spock
  4: JUnit Jupiter

1を選択。

あとは、Enterを押してdefault指定にする。

実行

./gradlew run

or

gradle run
Reusing configuration cache.

> Task :app:run
Hello World!

BUILD SUCCESSFUL in 479ms
2 actionable tasks: 1 executed, 1 up-to-date
Configuration cache entry reused.

テスト実行

./gradlew test

or

gradle test
Reusing configuration cache.

BUILD SUCCESSFUL in 456ms
3 actionable tasks: 3 up-to-date
Configuration cache entry reused.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?