Jenkins Could not find GradleWrapperMain

摘要: Create a Gradle project in Jenkins CI, source management with Git, and build with Gradle Wrapper

Create a Gradle project in Jenkins CI, source management with Git, and build with Gradle Wrapper

1. Problem

Jenkins console output, the build is failed – “Could not find org.gradle.wrapper.GradleWrapperMain”

[Gradle] - Launching build.
[workspace] $ /var/lib/jenkins/jobs/GradleTest/workspace/gradlew clean test
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE

2. Solution

2.1 The class GradleWrapperMain is inside the gradle-wrapper.jar, and Jenkins is unable to find it. I believe you forgot to check in the generated gradle-wrapper.jar

2.2 To fix it, create a Gradle wrapper again, and make sure the following files and folders are added to your version control system like GitHub.

|---gradle
    |---wrapper
        |---gradle-wrapper.jar
        |---gradle-wrapper.properties
|---gradlew
|---gradlew.bat 

Done.

References

  1. How to use Gradle Waapper
  2. Gradle Wrapper documentation

上一篇: Gradle Exclude commons-logging from Spring
下一篇: How to use Gradle Wrapper
 评论 ( What Do You Think )
名称
邮箱
网址
评论
验证
   
 

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号