CodeAlpha DevOps Internship — Task 3: Java Application using Gradle
A small but real Java command-line application built and managed entirely with Gradle — demonstrating automated builds, dependency management, unit testing, a CI/CD pipeline, and a packaged, deployable artifact.
The app itself is a Task Tracker: add tasks, list them, mark them done, and clear completed ones. Tasks persist to JSON on disk between runs.
- Build automation with Gradle — one command compiles, tests, and packages the app
- Dependency management — external libraries resolved from Maven Central
(
Gsonfor JSON,commons-lang3for string utilities) - Unit testing — JUnit 5 tests for the service and persistence layers
- CI/CD pipeline — GitHub Actions builds and tests on every push/PR and publishes the artifact
- Deployable output — the
applicationplugin produces a runnable distribution (start scripts + libraries) underbuild/distributions/ - Reproducible builds — the Gradle Wrapper and a Java toolchain pin the build environment
CodeAlpha_JavaGradleApp/
├── build.gradle # build logic, dependencies, plugins
├── settings.gradle
├── gradlew / gradlew.bat # Gradle Wrapper (no system Gradle needed)
├── gradle/wrapper/ # pinned Gradle version
├── .github/workflows/ci.yml
└── src/
├── main/java/com/codealpha/tasktracker/
│ ├── Main.java # CLI entry point
│ ├── Task.java # data model
│ ├── TaskService.java # core logic (pure, unit-tested)
│ └── TaskRepository.java # JSON persistence (Gson)
└── test/java/com/codealpha/tasktracker/
├── TaskServiceTest.java
└── TaskRepositoryTest.java
Prerequisite: JDK 21+ (the Wrapper downloads Gradle itself).
# Compile, run tests, and package
./gradlew build
# Run the app
./gradlew run --args="add Finish the DevOps task"
./gradlew run --args="list"
./gradlew run --args="done 1"
# Build a distributable package (start scripts + libs)
./gradlew installDist
./build/install/CodeAlpha_JavaGradleApp/bin/CodeAlpha_JavaGradleApp listOn Windows use gradlew.bat instead of ./gradlew.
JUnit 5 covers the core logic and persistence:
./gradlew testJava 21 · Gradle · JUnit 5 · Gson · Apache Commons Lang3 · GitHub Actions
Ali — CodeAlpha DevOps Internship, 2026