Giter Club home page Giter Club logo

hmcts.idam-bom's Introduction

IdAM BOM

Build Status License: MIT

The IdAM BOM project provides Maven BOM file that can be used for managing the versions of the dependencies in IdAM projects. This would ensure all projects always use a compatible stack.

Building the BOM

  • Create feature branch from master.
  • Commit changes and update BOM version.
  • Open PR when ready.
  • Obtain successful Travis PR build.
  • Peer review and merge.
  • Checkout master and tag HEAD with v<bom-version> ie. v1.6.6
  • Obtain successful tag build in Travis

Usage the BOM

There are 2 ways to use the BOM file:

Inheriting the BOM file
<project ...>
    <modelVersion>4.0.0</modelVersion>
    <groupId>uk.gov.hmcts.reform.idam</groupId>
    <artifactId>idam-state-of-the-art-project</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>IdAM State of the Art</name>
    <parent>
        <groupId>uk.gov.hmcts.reform.idam</groupId>
        <artifactId>idam-bom</artifactId>
        <version>1.0.0</version>
    </parent>
</project>
Importing the BOM file
<project ...>
    <modelVersion>4.0.0</modelVersion>
    <groupId>uk.gov.hmcts.reform.idam</groupId>
    <artifactId>idam-state-of-the-art-project</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>IdAM State of the Art</name>
         
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>uk.gov.hmcts.reform.idam</groupId>
                <artifactId>idam-bom</artifactId>
                <version>1.0.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>

Overriding a dependency defined in the BOM

The order of precedence of the artifact’s version is:

  • The version of the artifact’s direct declaration in your project pom
  • The version of the artifact in the parent project
  • The version in the imported pom, taking into consideration the order of importing files
  • Standard Maven dependency mediation (mvn uses "nearest definition" strategy, see Maven docs for more information)

If you are importing the BOM file or if you are overriding a dependency that's not explicitly defined there (meaning it's being imported from a third party BOM file), then you'd need to add an entry in the dependencyManagement of your project before the idam-bom entry.

<dependencyManagement>
    <dependencies>
        <!-- Override Mockito provided by IdAM BOM -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>2.12.0</version>
        </dependency>
        <dependency>
            <groupId>uk.gov.hmcts.reform.idam</groupId>
            <artifactId>idam-bom</artifactId>
            <version>1.0.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

If you are inheriting the BOM file and the dependency is explicitly defined in IdAM BOM (as opposed to being imported), then you can override individual dependencies by overriding a property in your own project.

<properties>
    <mockito.version>2.12.0</mockito.version>
</properties>

hmcts.idam-bom's People

Contributors

nikola-naydenov-hmcts avatar tbamido avatar dfourn avatar ivano-amido avatar matteoformica-merapar avatar blucas avatar jitumiah avatar nikolanaydenov avatar kremi avatar slonga avatar henrydobson avatar jburke-idam avatar steveclewer avatar matteoparussini avatar amiramido avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.