Skip to content

Commit

Permalink
Use gradle-versions-plugin to check for dependency updates.
Browse files Browse the repository at this point in the history
+ This plugin adds the "dependencyUpdates" Gradle task.
+ Version 0.27.0 is used because it is the last version being compatible
  with the Gradle version used in the project.
+ Plugin website: https://github.com/ben-manes/gradle-versions-plugin
  • Loading branch information
johnjohndoe committed Sep 30, 2020
1 parent 46c18b4 commit df5a537
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ buildscript {
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.0.RELEASE")
classpath("com.github.ben-manes:gradle-versions-plugin:0.27.0")
}
}


group = 'opacapi'
version = '1.0-SNAPSHOT'

apply from: 'gradle/gradle-versions.gradle'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
Expand Down
19 changes: 19 additions & 0 deletions gradle/gradle-versions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Gradle Versions Plugin

apply plugin: "com.github.ben-manes.versions"

dependencyUpdates {

def isNonStable = { String version ->
def stableKeyword = ["RELEASE", "FINAL", "GA"].any {
qualifier -> version.toUpperCase().contains(qualifier)
}
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}

rejectVersionIf {
isNonStable(it.candidate.version)
}

}

0 comments on commit df5a537

Please sign in to comment.