Hello,
I am currently trying to build a project, and it turns out that this is done through Gradle. The problem is that my Linux distribution in the office has no internet connection because of security policies. As part of the build process ‘Scala’ is needed, which I have installed and added to my PATH in ~/.bashrc
For some reason Gradle cannot locate Scala. I have no experience with Gradle, but before posting I tried to figure out how to use it for some hours. I am still no closer to thje solution so I am hoping you could give me some suggestions so the build can hopefully complete. This is what my build.gradle file looks like
build.gradle
apply plugin: 'java'
apply plugin: 'scala'
task wrapper(type: Wrapper) {
gradleVersion = '1.6'
}
defaultTasks 'jar'
description = 'Mines Java Toolkit'
sourceCompatibility = 1.7
sourceSets {
main {
output.resourcesDir = output.classesDir
}
test {
output.resourcesDir = output.classesDir
}
demo {
output.resourcesDir = output.classesDir
compileClasspath += sourceSets.main.runtimeClasspath
}
}
jar {
baseName 'edu_mines_jtk'
manifest {
attributes 'Implementation-Title': project.description
}
from sourceSets.demo.output // include demos
from sourceSets.test.output // include tests
}
javadoc {
title = project.description
}
repositories.mavenCentral() // for Scala jars
dependencies {
compile fileTree('libs') // contains jars provided with the Mines JTK
compile 'org.scala-lang:scala-library:2.10.+' // contains Scala jars
}
*************************** This is the output I get
*************************** [l0412595@nx09 jtk-master-new]$ gradlew :compileJava UP-TO-DATE :compileScala UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :compileDemoJava UP-TO-DATE :compileDemoScala
FAILURE: Build failed with an exception.
What went wrong: Could not resolve all dependencies for configuration ‘detachedConfiguration1’. Artifact ‘org.scala-lang:scala-compiler:2.10.2@jar’ not found.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.349 secs *************************
I have tried several things, but without succes. First of all I tried to remove the repositories.mavenCentral() line as I have no access to the internet on the Linux computer. I then tried to replace this with a flat directory repository as suggested by Chapter 49 of the online documentation
repositories {
flatDir {
dirs '/data/isilon/Users/l0412595/scala-2.10.2/lib'
}
}
Where the directory written down is the directory where the .jar files of ‘scala’ are stored. This didn’t work. I also tried adding a line to the dependencies
compile fileTree('/data/isilon/Users/l0412595/scala-2.10.2/lib')
But this also doesn’t fix the problem. At this point I have really run out of ideas and I would be very grateful if the community could help me. The problem I am facing is basically that I have no internet, but a working scala installation, yet I cannot get Gradle to make use of it.