0

I've installed Jenkins 2.6 as a docker container on a Windows 2012 Server machine.

I have created a project that checks out a project from git.

I've configured a build step that does a build using gradle wrapper 2.13

The gradle command fails with:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'test'.
> Could not open cp_proj remapped class cache for 6f7e45oinduki44jplv0c4r9s (/var/jenkins_home/.gradle/caches/2.13/scrip
ts-remapped/build_4xwqfk0ckitkb3fdwi5uf1f5e/6f7e45oinduki44jplv0c4r9s/cp_proj57408229).
   > java.io.FileNotFoundException: /var/jenkins_home/.gradle/caches/2.13/scripts-remapped/build_4xwqfk0ckitkb3fdwi5uf1f
5e/6f7e45oinduki44jplv0c4r9s/cp_proj57408229/classes/build_4xwqfk0ckitkb3fdwi5uf1f5e$_run_closure1$_closure3$_closure5.c
lass (Operation not permitted)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I've tried remoting into the container and running the gradle command manually but get the same error.

I found an article on the internet that recommended deleting the lock files: cache.properties.lock

This has not helped.

I've also tried restarting the container but this has not helped either.

Greg Pagendam-Turner
  • 2,356
  • 5
  • 32
  • 49
  • I found there is a file in that path called: /var/jenkins_home/.gradle/caches/2.13/scripts-remapped/build_4xwqfk0ckitkb3fdwi5uf1f5e/6f7e45oinduki44jplv0c4r9s/cp_proj57408229/classes/build_4xwqfk0ckitkb3fdwi5uf1f5e\$_run_closure1\$_closure2.class – Greg Pagendam-Turner May 27 '16 at 01:28
  • Tried building directly with gradle from the command line: /var/jenkins_home/.gradle/wrapper/dists/gradle-2.13-bin/4xs gxlfjcxvrea7akf941nvc7/gradle-2.13/bin/gradle buildImage Still the same issue – Greg Pagendam-Turner May 27 '16 at 01:45
  • Don't get this problem when running a Jenkins docker container in a CentOS 7 host. – Greg Pagendam-Turner May 27 '16 at 11:26
  • did you found the solution? It seems that I have the same problem – Aditzu Jul 28 '16 at 20:26
  • No I didn't find a solution for Windows so I used a Linux host instead – Greg Pagendam-Turner Jul 28 '16 at 23:14
  • Another solution would be to install Spring Boot App plugin under Eclipse and run project with it. Seems to work fine. Thank you! – Aditzu Jul 29 '16 at 09:16

2 Answers2

1

I had the same problem which at least for me was because of two reasons:

  1. My java home system variable was pointing for jdk7 instead of jdk8
  2. The proxy was blocking jCentral.

Solution:

  1. For first cause the solution is pretty simple. I just pointed the JAVA_HOME for having java 8 version
  2. In the user home directory(which for me was c:/users/)/.gradle i created a file named gradle.properties in which I put the next settings:

    systemProp.http.proxyHost=..

    systemProp.http.proxyPort=..

    systemProp.http.proxyUser=..

    systemProp.http.proxyPassword=..

    systemProp.https.proxyHost=..

    systemProp.https.proxyPort=..

    systemProp.https.proxyUser=..

    systemProp.https.proxyPassword=..

Hope this will be useful for someone else in the future.

Aditzu
  • 696
  • 1
  • 14
  • 25
  • My java home system variable was pointing for jdk7 instead of jdk8 -- This resolved my issue. Thanks. – Roshith Jul 10 '18 at 04:46
0

I searched for HOURS and tried numerous things but the only one that worked for me was going to "C:\Users\YOUR-USERNAME.gradle" and deleting the "cache" folder. Or rename it "cache-BACKUP" if you want to be cautious. Fixed everything for me.