repositories {
    mavenCentral()
}

//START SNIPPET define-dependency
configurations {
    compile
}

dependencies {
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
}
//END SNIPPET define-dependency

//START SNIPPET use-configuration
task listJars << {
    configurations.compile.each { File file -> println file.name }
}
//END SNIPPET use-configuration

configurations {
    runtime
}

//START SNIPPET module-dependencies
dependencies {
    runtime group: 'org.springframework', name: 'spring-core', version: '2.5'
    runtime 'org.springframework:spring-core:2.5', 'org.springframework:spring-aop:2.5'
    runtime(
        [group: 'org.springframework', name: 'spring-core', version: '2.5'],
        [group: 'org.springframework', name: 'spring-aop', version: '2.5']
    )
    runtime('org.hibernate:hibernate:3.0.5') {
        transitive = true
    }
    runtime group: 'org.hibernate', name: 'hibernate', version: '3.0.5', transitive: true
    runtime(group: 'org.hibernate', name: 'hibernate', version: '3.0.5') {
        transitive = true
    }
}
//END SNIPPET module-dependencies

//START SNIPPET dependencies-with-empty-attributes
dependencies {
    runtime ":junit:4.4", ":testng"
    runtime name: 'testng' 
}
//END SNIPPET dependencies-with-empty-attributes

//START SNIPPET dependency-configurations
dependencies {
    runtime group: 'org.somegroup', name: 'somedependency', version: '1.0', configuration: 'someConfiguration'
}
//END SNIPPET dependency-configurations


//START SNIPPET artifact-only
dependencies {
	runtime "org.groovy:groovy:1.5.6@jar"
    runtime group: 'org.groovy', name: 'groovy', version: '1.5.6', ext: 'jar'
}
//END SNIPPET artifact-only

//START SNIPPET client-modules
dependencies {
    runtime module("org.codehaus.groovy:groovy-all:1.7.6") {
        dependency("commons-cli:commons-cli:1.0") {
            transitive = false
        }
        module(group: 'org.apache.ant', name: 'ant', version: '1.7.0') {
            dependencies "org.apache.ant:ant-launcher:1.7.0@jar", "org.apache.ant:ant-junit:1.7.0"
        }
    }
}
//END SNIPPET client-modules

//START SNIPPET file-dependencies
dependencies {
    runtime files('libs/a.jar', 'libs/b.jar')
    runtime fileTree(dir: 'libs', include: '*.jar')
}
//END SNIPPET file-dependencies

//START SNIPPET list-grouping
List groovy = ["org.codehaus.groovy:groovy-all:1.7.6@jar",
               "commons-cli:commons-cli:1.0@jar",
               "org.apache.ant:ant:1.7.0@jar"]
List hibernate = ['org.hibernate:hibernate:3.0.5@jar', 'somegroup:someorg:1.0@jar']
dependencies {
	runtime groovy, hibernate
}
//END SNIPPET list-grouping
