/require-latest-versions-enforcer-rule

Maven enforcer rule for ensuring a project is using the latest version of certain dependencies

Primary LanguageJava

Require Latest Versions

Build Status Coverage Status

A Maven Enforcer rule for ensuring that any project using the raml-maven-plugin depending on the latest released version of any RAML dependencies. This is done by comparing version numbers and if the version is out of date, whether there are any modifications in the RAML or JSON schema files.

Custom filename filters using regular expressions can be used to control which file modifications are considered to be differences.

Usage

Add the plugin to the build plugins section of any project which is using raml-maven-plugin:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <dependencies>
        <dependency>
            <groupId>uk.gov.justice.maven</groupId>
            <artifactId>require-latest-versions-enforcer-rule</artifactId>
            <version>1.1.0</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <id>enforce</id>
            <configuration>
                <rules>
                    <RequireLatestRamlVersionsRule implementation="uk.gov.justice.maven.rules.RequireLatestMojInterfaceRule">
                        <filter>^raml/json/schema/?|.*raml$</filter>                                        
                    </RequireLatestRamlVersionsRule>
                    <RequireLatestDependencyVersionRule implementation="uk.gov.justice.maven.rules.RequireLatestDependencyVersionRule">
                        <artifactIds>
                            <artifactId>common-core-domain</artifactId>
                        </artifacts>                   
                    </RequireLatestDependencyVersionRule>
                    <RequireLatestServiceParentVersionRule implementation="uk.gov.justice.maven.rules.RequireLatestServiceParentVersionRule"/>
                </rules>
            </configuration>
            <goals>
                <goal>enforce</goal>
            </goals>
        </execution>
    </executions>
</plugin>