Skip to content

Java project build externalization by put its config into separate repository

License

Notifications You must be signed in to change notification settings

andrei-punko/composite-build-usage-example

Repository files navigation

Composite Build usage example

Java CI with Gradle Coverage Branches

Based on this Spring Boot app template. Sources was not changed almost, only build script adjusted

Prerequisites

  • JDK 21
  • Docker
    Gradle isn't required because of embedded Gradle in the project

Conception description

Composite Build is externalization of build by put dependencies and plugins into separate Git repository (which added to project as Git submodule)

After that build script looks like this:

import by.andd3dfx.build.*
import by.andd3dfx.build.Plugins.Companion.applyPlugins

service(version = "0.0.1") {
    dependencies {
        springBoot {
            web()
            test()
            dataJpa()
            validation()
            ...
        }

        lombok()
        apacheCommonsLang()
        mapstruct()
        springDoc()
        swagger()
        postgres()
        h2()
        flywayCore()
        testContainers()
        postgresTestContainers()
        ...

        applyPlugins {
            springBoot()
        }
    }
}

Initialize Git submodule with build configuration:

git submodule init
git submodule update

How to build application:

gradlew clean build

Run functional tests:

cd func-test
./gradlew clean build

Check functional test report here

About

Java project build externalization by put its config into separate repository

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published