我是Jenkins的新手,我想将它用于我的gradle项目。我下载了Jenkins的gradle插件,但是当我尝试构建我的应用程序时,我得到了
Building in workspace /home/alexi/Documents/workspace/testJenkins
[Gradle] - Launching build.
[testJenkins] $ /home/alexi/Documents/workspace/testJenkins/gradlew clean build test
:clean UP-TO-DATE
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
java.io.FileNotFoundException: /home/alexi/Documents/workspace/testJenkins/.gradle/2.13/taskArtifacts/cache.properties.lock (Permission denied)
> /home/alexi/Documents/workspace/testJenkins/.gradle/2.13/taskArtifacts/cache.properties.lock (Permission denied)
* 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: 4.147 secs
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
我试图将chmod 777放到.gradle目录中,但我仍然遇到此错误。
在我的构建步骤中,我有一个新的gradle步骤,我使用Gradle Wrapper
然后make gradlew executable
,我还会检查字段From Root Build Script Dir
。我正在执行的任务是clean build test
另外,当我在Spring Tools SUite / Eclipse中运行这些命令时,它完美运行,我的Jenkins在localhost上
答案 0 :(得分:1)
解决方案是删除项目中已存在的.gradle文件(使用Spring Boot创建)