我是Grails / Gradle的新手。我正在尝试编写一个简单的build.gradle来构建我的示例项目。我有一个任务“构建”,内部应该按给定的顺序执行以下操作。
我正在使用这里提到的gradle / grails插件和build.gradle Gradle/Grails plugin。默认情况下,此插件提供干净,测试和组装任务。在这里使用这个插件是我的build.gradle的样子,
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..." }
在命令提示符下执行“gradle build”时,我遇到了以下异常。
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
这是正确的做法,非常感谢任何帮助。
谢谢你, 交换。