I've a multiple module gradle project.
Root has the following modules : core, app (dependent on core), web(dependent on app,core)
From https://plugins.gradle.org/plugin/io.spring.dependency-management
I have used
plugins { id "io.spring.dependency-management" version "0.5.4.RELEASE" }
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:+' // 2.0.1.RELEASE
}
}
inside the build.gradle of core.
When I triggered
gradle clean build
from root command prompt, core jar was built successfully, but app failed to resolve the versions of the dependencies.
common.gradle in root directory
repositories {
mavenCentral()
maven { url "http://repo.grails.org/grails/repo/" }
// mavenLocal()
}
build.gradle of Core
plugins {
id "io.spring.dependency-management" version "0.5.4.RELEASE"
}
apply from: '../common.gradle'
apply plugin: 'java'
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:+' // 2.0.1.RELEASE
}
}
dependencies {
compile 'javax.jms:javax.jms-api:+' //2.0
compile 'javax.mail:mail:+' //1.4.6
compile 'javax.validation:validation-api' //1.0.0.GA
compile 'org.springframework.security:spring-security-ldap' //4.0.1.RELEASE
compile 'org.springframework.data:spring-data-jpa' //1.9.1.RELEASE
compile 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:+' //1.0.0.Final
}
build.gradle for app module
apply plugin: 'java'
apply from: '../common.gradle'
dependencies {
compile project(':Core')
compile 'org.hibernate:hibernate-validator' //5.1.1.Final
compile 'net.sf.ehcache:ehcache' //2.9.1
compile 'org.springframework:spring-jms' //4.2.3.RELEASE
compile 'org.springframework:spring-oxm' //3.0.4.RELEASE }
Error message snippet:
FAILURE: Build failed with an exception.
- What went wrong:
Could not resolve all dependencies for configuration ':app:compile'.
Could not find org.hibernate:hibernate-validator:. Searched in the following locations: https://repo1.maven.org/maven2/org/hibernate/hibernate-validator//hibernate-validator-.pom https://repo1.maven.org/maven2/org/hibernate/hibernate-validator//hibernate-validator-.jar http://repo.grails.org/grails/repo/org/hibernate/hibernate-validator//hibernate-validator-.pom http://repo.grails.org/grails/repo/org/hibernate/hibernate-validator//hibernate-validator-.jar Required by: Root:app:unspecified
Environment :
D:\personal>gradle -v
Gradle 2.9
Build time: 2015-11-17 07:02:17 UTC Build number: none Revision: b463d7980c40d44c4657dc80025275b84a29e31f
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_20 (Oracle Corporation 25.20-b23)
OS: Windows 7 6.1 amd64