Reputation: 5469
XML being one of the reasons people move to Gradle, our project defines several pom packaged items. I assume that these are BOM's since they just used to pull in dependencies. So... how do you define a BOM in Gradle from a "best practices" / no XML perspective? I know that you can create a configuration that has dependencies and then just include it but I don't, for example, want "gradle build" to create a jar file for this sub-project as it would be pointless and slow down my build for no good reason. Am I on the right track or is there a better way and if so, what is it? Do I just turn off the jar creation somehow?
Upvotes: 4
Views: 1973
Reputation: 5469
I think this is what I need. It's from right out of the Gradle User Guild in Chapter 52. Specifically it's Example 52.16. "Collections and arrays of dependencies".
List groovy = ["org.codehaus.groovy:groovy-all:2.4.4@jar",
"commons-cli:commons-cli:1.0@jar",
"org.apache.ant:ant:1.9.4@jar"]
List hibernate = ['org.hibernate:hibernate:3.0.5@jar',
'somegroup:someorg:1.0@jar']
dependencies {
runtime groovy, hibernate
}
Upvotes: 4