Created
September 23, 2014 19:29
-
-
Save breskeby/488817c36223ea6379f9 to your computer and use it in GitHub Desktop.
whitelisted dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.1.1.RELEASE' | |
} | |
} | |
apply plugin: 'spring-boot' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
versionManagement 'io.spring.platform:platform-versions:1.0.0.RELEASE@properties' | |
compile 'org.springframework:spring-core' | |
compile 'org.springframework.data:spring-data-jpa' | |
} | |
Properties whitelist = new Properties() | |
configurations.versionManagement.singleFile.withInputStream { | |
stream -> whitelist.load(stream) | |
} | |
project.configurations.all { | |
resolutionStrategy.eachDependency { details -> | |
String version = whitelist.get(details.requested.group + ":" + details.requested.name) | |
if (version) { | |
details.useVersion(version) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this results in