I am new to Grails/Gradle. I am trying to write a simple build.gradle to build my sample project. I have a task "build" which internally should do the following in the given sequence.
- clean
- compile
- run tests
- create a war file
I am using the gradle/grails plugin and build.gradle mentioned here, Gradle/Grails plugin. This plugin provides clean,test and assemble tasks by default. Using this plugin here's how my build.gradle looks like,
import org.grails.gradle.plugin.GrailsTask
buildscript {
repositories {
mavenCentral()
mavenRepo name: "grails", url: 'http://repo.grails.org/grails/repo'
}
dependencies {
classpath "org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT"
}
}
repositories {
mavenCentral()
mavenRepo name: "grails", url: 'http://repo.grails.org/grails/repo'
}
version = "1.0"
grailsVersion = "2.1.0"
apply plugin: "grails"
dependencies {
['dependencies', 'resources', 'core', 'hibernate', 'plugin-datasource', 'plugin-domain-class', 'plugin-tomcat', 'plugin-services'].each { plugin ->
compile "org.grails:grails-$plugin:2.1.0"
}
bootstrap "org.codehaus.groovy:groovy-all:1.8.7"
}
task build (dependsOn: [clean,test,assemble]) {
println "building the project..." }
On executing "gradle build" from the command prompt, I am running into following exception.
12:03:28.631 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.Un
satisfiedLinkError: Native Library C:\Users\smore\AppData\Local\Temp\jline_.dll
already loaded in another classloader
12:03:28.635 [ERROR] [org.gradle.BuildExceptionReporter] at jline.Windows
Terminal.loadLibrary(WindowsTerminal.java:322)
12:03:28.638 [ERROR] [org.gradle.BuildExceptionReporter] at jline.Windows
Terminal.initializeTerminal(WindowsTerminal.java:240)
12:03:28.642 [ERROR] [org.gradle.BuildExceptionReporter] at jline.Termina
l.setupTerminal(Terminal.java:75)
12:03:28.646 [ERROR] [org.gradle.BuildExceptionReporter] at jline.Termina
l.getTerminal(Terminal.java:26)
12:03:28.649 [ERROR] [org.gradle.BuildExceptionReporter] at jline.Console
Reader.<init>(ConsoleReader.java:174)
12:03:28.653 [ERROR] [org.gradle.BuildExceptionReporter] at jline.Console
Reader.<init>(ConsoleReader.java:169)
12:03:28.657 [ERROR] [org.gradle.BuildExceptionReporter] at grails.build.
logging.GrailsConsole.createConsoleReader(GrailsConsole.java:167)
12:03:28.660 [ERROR] [org.gradle.BuildExceptionReporter] at grails.build.
logging.GrailsConsole.<init>(GrailsConsole.java:133)
12:03:28.664 [ERROR] [org.gradle.BuildExceptionReporter] at grails.build.
logging.GrailsConsole.createInstance(GrailsConsole.java:267)
12:03:28.668 [ERROR] [org.gradle.BuildExceptionReporter] at grails.build.
logging.GrailsConsole.getInstance(GrailsConsole.java:244)
12:03:28.672 [ERROR] [org.gradle.BuildExceptionReporter] ... 71 more
12:03:28.675 [ERROR] [org.gradle.BuildExceptionReporter]
12:03:28.679 [LIFECYCLE] [org.gradle.BuildResultLogger]
12:03:28.683 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
Is this right approach, Any help would be greatly appreciated.
Thank you, swap.