I got a Scalding (a hadoop abstraction layer in Scala) project that I'm trying to build using Gradle.
Looks like Hadoop became a provided dependency in latest releases and it requires some workaround.
So I patched my build.gradle script like so:
apply plugin: 'scala'
apply plugin: 'idea'
configurations {
provided
}
sourceSets {
main { compileClasspath += configurations.provided }
}
repositories {
mavenLocal()
mavenCentral()
maven{
url 'http://conjars.org/repo/'
}
}
ext.cascadingVersion = '2.1.6'
ext.hadoopVersion = '1.1.2'
dependencies {
compile 'org.scala-lang:scala-compiler:2.9.2'
compile 'org.scala-lang:scala-library:2.9.2'
compile 'bixo:bixo-core:0.9.1'
compile 'org.testng:testng:6.8.7'
testCompile 'org.scala-tools.testing:specs:1.6.2.2_1.5.0'
compile( 'com.twitter:scalding_2.9.2:0.8.1' )
compile( group: 'cascading', name: 'cascading-core', version: cascadingVersion )
compile( group: 'cascading', name: 'cascading-hadoop', version: cascadingVersion )
provided "org.apache.hadoop:hadoop-client:${hadoopVersion}"
}
jar {
description = "Assembles a Hadoop-ready JAR file"
doFirst {
into( 'lib' ) {
from configurations.compile
}
}
manifest {
attributes( "Main-Class": "com.Crawler" )
}
}
Which I thought would solve the problem. But I keep getting the following error at when trying to build:
[ant:scalac] Element '/Users/tkmafj4/Projects/AIT/Crawler/build/resources/main' does not exist.
[ant:scalac] scala.tools.nsc.symtab.Types$TypeError: class file needed by Source is missing.
[ant:scalac] reference value hadoop of package org.apache refers to nonexisting symbol.
Which looks a lot like there's something missing in my configuration.
How can I check that sources are being fetched?
What is the proper workaround to get this to compile?