repositories {
    mavenCentral()
}

configurations {
    compile
    runtime
}

//START SNIPPET define-dependency
dependencies {
    compile group: 'org.hibernate', name: 'hibernate-core', version: '3.6.7.Final'
}
//END SNIPPET define-dependency

//START SNIPPET define-dependency-shortcut
dependencies {
    compile 'org.hibernate:hibernate-core:3.6.7.Final'
}
//END SNIPPET define-dependency-shortcut

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

//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.8.2", ":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.10") {
        dependency("commons-cli:commons-cli:1.0") {
            transitive = false
        }
        module(group: 'org.apache.ant', name: 'ant', version: '1.8.2') {
            dependencies "org.apache.ant:ant-launcher:1.8.2@jar", "org.apache.ant:ant-junit:1.8.2"
        }
    }
}
//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.10@jar",
               "commons-cli:commons-cli:1.0@jar",
               "org.apache.ant:ant:1.8.2@jar"]
List hibernate = ['org.hibernate:hibernate:3.0.5@jar', 'somegroup:someorg:1.0@jar']
dependencies {
	runtime groovy, hibernate
}
//END SNIPPET list-grouping
