I'm trying to setup simple webapp with gradle 1.7, jetty 9.2 and intellij IDEA 13.
Here some typical config lines of gradle build found in tutorials I'm using:
apply plugin: 'jetty'
sourceCompatibility = 1.5
version = '1.1'
repositories {
mavenCentral()
}
dependencies {
providedCompile 'javax.servlet:servlet-api:2.5'
// other dependencies
}
Configuration to launch in IDEA is in Edit Configurations...->Add->Gradle
, task is jettyRun
.
For the first run all works fine, jetty starts, the webapp is availailable in a browser.
But if I change something in the gradle.build
file and rerun the task following error will occur:
A problem occurred configuring root project 'gr3'.
Could not open buildscript class cache for build file 'D:\Work\priv\gr3\build.gradle' (C:\Users\Sazankov_LY\.gradle\caches\1.7\scripts\build_546r8n6d85n2abfbi95h2qqmh4\ProjectScript\buildscript).
Timeout waiting to lock buildscript class cache for build file 'D:\Work\priv\gr3\build.gradle' (C:\Users\Sazankov_LY\.gradle\caches\1.7\scripts\build_546r8n6d85n2abfbi95h2qqmh4\ProjectScript\buildscript). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 11948
Owner Operation: unknown
Our operation:
Lock file: C:\Users\Sazankov_LY\.gradle\caches\1.7\scripts\build_546r8n6d85n2abfbi95h2qqmh4\ProjectScript\buildscript\cache.properties.lock
The only way to continue working is restarting IDE
Any ideas?
After some research I've found out that problem is in correct terminating jetty. If you stop jetty by "Terminate" button on IDEA's toolbar, lock remains on the cache file. So you need to stop jetty via jettyStop
task. Also you need to specify stopKey
and stopPort
for successful task executing.
delete the lock file
sudo rm -f <lockfile>
kill the pid
kill -9 <pid>
Try again
gradle jettyRun -PbuildProfile=<profile>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With