Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Revert "[#70] Remove hack with putting dependencies versions in pom.xml"
Browse files Browse the repository at this point in the history
There is a bug in dependency-management-plugin 0.3.0 which fails the
build:
spring-gradle-plugins/dependency-management-plugin#21

This reverts commit 14c4ab3.
  • Loading branch information
szpak committed Dec 18, 2014
1 parent 14c4ab3 commit 8a6d251
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
classpath 'com.ofg:uptodate-gradle-plugin:+'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:+'
classpath 'pl.allegro.tech.build:axion-release-plugin:0.9.9'
classpath "io.spring.gradle:dependency-management-plugin:0.3.0.RELEASE"
classpath "io.spring.gradle:dependency-management-plugin:0.2.1.RELEASE"
if (project.hasProperty("coverage")) { classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:+' }
if (project.hasProperty("compatibility")) { classpath "be.insaneprogramming.gradle:animalsniffer-gradle-plugin:+" }
}
Expand Down Expand Up @@ -53,6 +53,7 @@ task addHashFile << {
def srcSubprojects = subprojects - project(':swagger')
configure(srcSubprojects) {
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.ofg.uptodate'
Expand Down Expand Up @@ -129,6 +130,17 @@ configure(srcSubprojects) {
}.each() {
it.scope*.value = 'compile'
}
//#70 - workaround for empty version in pom.xml when dependency-management-plugin is used
//Known limitation of new Gradle publishing mechanism - https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8
asNode().dependencies[0]?.get('dependency')?.each() { dep ->
String pomVer = dep.get("version").text();
String pomArtifactId = dep.get("artifactId").text();
String pomGroupId = dep.get("groupId").text();
if (pomVer.isEmpty()) {
def depVer = project.dependencyManagement.getManagedVersion("$pomGroupId", "$pomArtifactId")
dep.appendNode('version', depVer)
}
}
}
}
}
Expand Down

0 comments on commit 8a6d251

Please sign in to comment.