Skip to content

Migrate to Gradle as build tool#540

Closed
DerDaehne wants to merge 6 commits into
developfrom
feature/gradlebuild
Closed

Migrate to Gradle as build tool#540
DerDaehne wants to merge 6 commits into
developfrom
feature/gradlebuild

Conversation

@DerDaehne

@DerDaehne DerDaehne commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This PR migrates the project from Maven to Gradle as its build tool. This lays the foundation for a broader codebase transition, moving from Groovy to Kotlin.

DerDaehne and others added 6 commits July 13, 2026 14:44
Migrate the project build system to Gradle 8.10.2 using the Micronaut application plugin and John Rengelman's Shadow plugin. Configure test JVM heap limits to avoid OutOfMemoryError, separation of unit and integration tests, dynamic Git metadata generation for VersionName, and update Dockerfile and developers guide.

Co-authored-by: Gemini CLI <gemini-cli@cloudogu.com>
Update .dockerignore to allow settings.gradle, build.gradle, and the gradle wrapper files while removing obsolete Maven files.

Co-authored-by: Gemini CLI <gemini-cli@cloudogu.com>
Introduce Kotlin and KAPT plugins to build.gradle for migrating Groovy code to Kotlin. Registers src/main/kotlin and configures jvmTarget 17.

Co-authored-by: Gemini CLI <gemini-cli@cloudogu.com>
Convert the leaf-level Groovy enums ScmProviderType and ReturnCode to Kotlin. Configure compileGroovy and compileTestGroovy tasks in build.gradle to depend on and include compiled Kotlin classes in their classpaths, enabling seamless hybrid Groovy/Kotlin compilation.

Co-authored-by: Gemini CLI <gemini-cli@cloudogu.com>
Update Jenkinsfile to use GRADLE_IMAGE (eclipse-temurin:17-jdk-alpine) and mount gradle-cache. Replace 'mvn test' and integration test calls with ./gradlew commands, update JUnit test result patterns to point to build/test-results, and apply org.sonarqube plugin in build.gradle.

Co-authored-by: Gemini CLI <gemini-cli@cloudogu.com>
Change org.sonarqube plugin version in build.gradle to 7.3.1.8318, which is the correct and fully compatible version on Gradle Plugin Portal.

Co-authored-by: Gemini CLI <gemini-cli@cloudogu.com>
@DerDaehne
DerDaehne marked this pull request as ready for review July 14, 2026 07:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the project’s build and CI workflow from Maven to Gradle (via Gradle Wrapper), while beginning the codebase transition path by moving small shared enums from Groovy to Kotlin.

Changes:

  • Replaced Maven build configuration (pom + mvnw) with a Gradle build (build.gradle + settings.gradle + wrapper).
  • Updated CI (Jenkinsfile) and container build (Dockerfile/.dockerignore) to run Gradle tasks and use Gradle caching.
  • Migrated ReturnCode and ScmProviderType enums from Groovy to Kotlin equivalents.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/kotlin/com/cloudogu/gitops/config/scm/util/ScmProviderType.kt Kotlin enum replacement for Groovy ScmProviderType.
src/main/kotlin/com/cloudogu/gitops/cli/ReturnCode.kt Kotlin enum replacement for Groovy ReturnCode.
src/main/groovy/com/cloudogu/gitops/config/scm/util/ScmProviderType.groovy Removes Groovy enum after Kotlin migration.
src/main/groovy/com/cloudogu/gitops/cli/ReturnCode.groovy Removes Groovy enum after Kotlin migration.
settings.gradle Adds Gradle settings and plugin management repositories.
build.gradle Introduces Gradle build (Micronaut, Shadow, JaCoCo, Kotlin, Sonar).
gradlew / gradlew.bat Adds Gradle Wrapper scripts for Unix/Windows.
gradle/wrapper/gradle-wrapper.properties Pins Gradle distribution for wrapper.
pom.xml Removes Maven build definition.
mvnw / mvnw.cmd Removes Maven Wrapper scripts.
.mvn/wrapper/maven-wrapper.properties Removes Maven wrapper properties.
Jenkinsfile Switches pipeline steps from Maven to Gradle tasks and cache volumes.
Dockerfile Updates multi-stage build to cache and build with Gradle (shadowJar).
.dockerignore Updates docker build context allowlist for Gradle build inputs.
docs/Developers.md Updates developer workflow documentation to use Gradle commands.
Comments suppressed due to low confidence (1)

.dockerignore:30

  • This comment still refers to Maven and contains a typo ("minium"). Since the build metadata is now produced via Gradle, update the wording to avoid confusion.
!gradle/
!compiler.groovy

# Including .git is risky, but required so maven can read the build number. At least keep it to a minium.
!.git/HEAD

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Jenkinsfile
Comment on lines 200 to 204
post {
always {
junit testResults: "**/target/failsafe-reports/TEST-*.xml",
junit testResults: "**/build/test-results/**/*.xml",
allowEmptyResults: true
}
Comment thread docs/Developers.md
Comment on lines +484 to +488
Or run build and run via gradle and java:

````shell
mvn package -DskipTests
java -classpath target/gitops-playground-cli-0.1.jar org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain \
./gradlew shadowJar
java -classpath build/libs/gitops-playground-cli-0.1-all.jar org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain \
@DerDaehne

Copy link
Copy Markdown
Contributor Author

we will stick with maven for now. closing

@DerDaehne DerDaehne closed this Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants