Skip to content

govuk-one-login/ipv-cri-lime-shared

Repository files navigation

ipv-cri-lime-shared

A shared library repository maintained by the Lime team.

Publishable subprojects follow the lib-* naming convention. Only these are included in the publishAll task.

Versioning

Each subproject manages its own version in its gradle.properties:

# lib-limeade/gradle.properties
artifactId=limeade
version=1.0.0
description=Limeade shared library

The group id is defined once at the root level in gradle.properties:

# gradle.properties
group=uk.gov.account.ipv.cri.lime

Published coordinates take the form: {group}:{artifactId}:{version}

Publishing

Libraries are published to Maven Central. Publishing is triggered automatically on merge to main via the publish.yml GitHub Actions workflow.

The build will skip publishing any version that already exists on Maven Central. Only a version bump in the subproject's gradle.properties will result in a new artefact being published. Non-versioned changes (refactors, test updates, formatting fixes, etc.) merged to main will not produce a new release.

To publish locally for testing:

./gradlew publishAllToMavenLocal

Don't forget to include mavenLocal() in the consuming projects maven repositories configuration.

Adding a New Library

  1. Create the subproject directory following the lib-* naming convention:

    lib-mylib/
    ├── src/main/java/
    ├── build.gradle
    └── gradle.properties
    
  2. Set the artefact id and initial version in the subproject's gradle.properties:

    artifactId=mylib
    version=1.0.0
    description=My new shared library
  3. Register the subproject in the root settings.gradle:

    include 'lib-limeade'
    include 'lib-mylib'   // new lib
  4. Configure the subproject build in lib-mylib/build.gradle. Follow the pattern in lib-limeade/build.gradle. Apply the required plugins, declare dependencies from libs.versions.toml, and apply any publishing configuration inherited from the root.

The root build.gradle automatically picks up any lib-* subproject and includes it in publishAll.

Build System

All shared build logic is managed at the root build.gradle. Subproject builds only define what is specific to that module (plugins, dependencies).

Requirements:

  • Java 21 (Amazon Corretto) — see .sdkmanrc
  • Gradle 9 (via wrapper — use ./gradlew)

Run checks locally:

./gradlew spotlessCheck unitTestCodeCoverageReport

About

Common Java code in use by Lime maintained CRIs

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages