Skip to content

Instantly share code, notes, and snippets.

@mrmichalis
Created February 28, 2013 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrmichalis/5057396 to your computer and use it in GitHub Desktop.
Save mrmichalis/5057396 to your computer and use it in GitHub Desktop.
Groovy CDH4 v 4.2 project
// original https://gist.github.com/sit/3606537
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
group = "com.mycompany.hadoopproject"
version = "1.0"
repositories {
// Standard Maven
mavenCentral()
maven {
url "https://repository.cloudera.com/artifactory/cloudera-repos/"
}
}
// Mimic Maven 'provided' configuration, as suggested in GRADLE-784
configurations {
provided
}
sourceSets {
main {
compileClasspath += configurations.provided
}
}
ext.hadoopVersion = "2.0.0-cdh4.2.0"
dependencies {
provided "org.apache.hadoop:hadoop-client:${hadoopVersion}"
// Example of adding a specific compile time dependency
compile "com.google.guava:guava:11.0.2"
testCompile "junit:junit:4.8.2"
}
// Java version selection
sourceCompatibility = 1.6
targetCompatibility = 1.6
eclipse {
classpath {
// Ensure Eclipse build output appears in build directory
defaultOutputDir = file("${buildDir}/eclipse-classes")
// Ensure the provided configuration jars are available in Eclipse
plusConfigurations += configurations.provided
}
}
// Emulate Maven shade plugin with a fat jar.
// http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-Creatingafatjar
jar {
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment