Skip to content

Instantly share code, notes, and snippets.

@jlafourc
Last active August 16, 2019 08:09
Show Gist options
  • Save jlafourc/379da4500d205ca88e151c3803f06ade to your computer and use it in GitHub Desktop.
Save jlafourc/379da4500d205ca88e151c3803f06ade to your computer and use it in GitHub Desktop.
Gradle scripts to generate a BOM and then consume that BOM
plugins {
id "io.spring.dependency-management" version "1.0.0.RC2"
}
project.group = com.company
project.version = 1.0.0
project.ext.name = company-project
dependencyManagement {
imports {
mavenBom('com.company:company-bom:1.0.0') {
bomProperty 'spring.version', '4.0.4.RELEASE'
}
}
}
plugins {
id "io.spring.dependency-management" version "1.0.0.RC2"
}
apply plugin: 'maven-publish'
project.group = com.company
project.version = 1.0.0
project.ext.name = company-bom
dependencyManagement {
properties {
property 'spring.version:4.1.1.RELEASE'
}
dependencies {
dependency 'org.springframework:spring-core:${spring.version}'
dependency group:'commons-logging', name:'commons-logging', version:'1.1.2'
}
}
publishing {
publications {
mavenJava(MavenPublication) {
}
}
}
plugins {
id "io.spring.dependency-management" version "1.0.0.RC2"
}
apply plugin: 'maven-publish'
project.group = com.company
project.version = 1.0.0
project.ext.name = company-bom
dependencyManagement {
dependencies {
dependency 'org.springframework:spring-core:${spring.version}' // where do I specify a default spring.version ?
dependency group:'commons-logging', name:'commons-logging', version:'1.1.2'
}
}
publishing {
publications {
mavenJava(MavenPublication) {
}
}
}
@arulrajnet
Copy link

Getting versions from project properties is broken in 1.0.6.RELEASE version of plugin. spring-gradle-plugins/dependency-management-plugin#17 Seems regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment