DEVOPS (BCSL657D)
Program 3. Working with Gradle: Setting Up a Gradle
Project, Understanding Build Scripts (Groovy and
Kotlin DSL), Dependency Management and Task
Automation.
Create a new Gradle project:
Step 1: Create a new Gradle project using the command line:
gradle init --type java-application
while creating project it will ask necessary requirement:
Enter target Java version (min: 7, default: 21): 21
Project name (default: program3-groovy): Prog3_groovyProject
Select application structure:
1: Single application project
2: Application and library project
Enter selection (default: Single application project) [1..2] 1
Select build script DSL:
1: Kotlin
2: Groovy
Enter selection (default: Kotlin) [1..2] 2
Select test framework:
1: JUnit 4
2: TestNG
3: Spock
4: JUnit Jupiter
Enter selection (default: JUnit Jupiter) [1..4] 1
Generate build using new APIs and behavior (some features may
change in the next minor release)? (default: no) [yes, no]
no
Step 2: Run Gradle Commands
To build the project:
gradle build
To run the project:
gradle run
To test the project:
gradle test