Skip to content

Helping Gradle projects stay up to date with the latest and greatest dependencies.

License

Notifications You must be signed in to change notification settings

mxenabled/vogue

Repository files navigation

Release

Vogue

Keep your dependencies fashionably up-to-date.

What is this?

Vogue is a gradle plugin that reads and processes reports generated by the gradle-versions-plugin. This is intended to be used as a "gatekeeper" to prevent dependencies from getting too far out of date while also providing utilities to easily upgrade outdated dependencies.

Installing

Gradle

build.gradle:

plugins {
  id: "com.github.mxenabled.vogue" version "1.0.3"
}

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

settings.gradle:

pluginManagement {
  repositories {
    ...
    maven { url "https://jitpack.io" }
  }
}

Configuration

Example configuration with default values:

In the build.gradle

vogue {
  excludePreReleaseVersions = true // Set to false to include #.#.#.pre versions in the report.
  dependencyUpdatesOutputDir = "build/dependencyUpdates" // Where the report generated by the `gradle-versions-plugin` is located.
}

Usage

Scan the project dependencies and produce a report of available upgrades.

$ ./gradlew vogueReport

Configuring Rules

Rules can be configured in a version-controlled .vogue.yml file located at the root of the project. If a rule is violated, the report will return a failing status code (which can be used in a CI/CD pipeline).

Global Defaults

Global default rules can be configured via the following syntax:

defaultRules:
  major:
    maxDiff: 1 # Every dependency can be at most one major version out-of-date, otherwise an error will be produced.
  minor:
    requireLatest: true # Every dependency must be on the latest minor version.
  patch:
    requireLatest: true # Every dependency must be on the latest patch version.

If no package-specific rule has been configured for a given dependency, the default rules will be used.

Package Rules

This syntax defines a rule for any com.github.mxenabled.* dependency and requires that you are always on the most current version.

packageRules:
  -
    package: "com.github.mxenabled.*"
    rules:
      major:
        requireLatest: true
      minor:
        requireLatest: true
      patch:
        requireLatest: true

Suppressing Violations

Occasionally you might need to suppress a dependency violation so that your CI/CD pipeline will pass (if you have Vogue configured as a required step).

Running vogueSuppress will walk you through your dependency violations and allow you to suppress errors for a given time range (3 months max).

$ ./gradlew vogueSuppress

Deploying Locally

To create a local build of vogue use

$ ./gradlew clean publishToMavenLocal

This will create a local build in your local maven repository that you can then reference in other services.

On OXS using gradle the default location for the local maven repository is

~/.m2/repository/com/mx/vogue/