搭建Gradle环境

构建成功

  1. Starting Gradle Daemon...
  2. Gradle Daemon started in 1 s 688 ms
  3. > Task :buildSrc:compileJava UP-TO-DATE
  4. > Task :buildSrc:compileGroovy NO-SOURCE
  5. > Task :buildSrc:pluginDescriptors UP-TO-DATE
  6. > Task :buildSrc:processResources UP-TO-DATE
  7. > Task :buildSrc:classes UP-TO-DATE
  8. > Task :buildSrc:jar UP-TO-DATE
  9. > Task :buildSrc:generateSourceRoots UP-TO-DATE
  10. > Task :buildSrc:assemble UP-TO-DATE
  11. > Task :buildSrc:pluginUnderTestMetadata UP-TO-DATE
  12. > Task :buildSrc:compileTestJava NO-SOURCE
  13. > Task :buildSrc:compileTestGroovy NO-SOURCE
  14. > Task :buildSrc:processTestResources NO-SOURCE
  15. > Task :buildSrc:testClasses UP-TO-DATE
  16. > Task :buildSrc:test SKIPPED
  17. > Task :buildSrc:validateTaskProperties UP-TO-DATE
  18. > Task :buildSrc:check SKIPPED
  19. > Task :buildSrc:build UP-TO-DATE
  20. > Task :help
  21. Welcome to Gradle 5.6.4.
  22. To run a build, run gradle <task> ...
  23. To see a list of available tasks, run gradle tasks
  24. To see a list of command-line options, run gradle --help
  25. To see more detail about a task, run gradle help --task <task>
  26. For troubleshooting, visit https://help.gradle.org
  27. BUILD SUCCESSFUL in 1m 14s
  28. 1 actionable task: 1 executed
  29. > Task :help
  30. Welcome to Gradle 5.6.4.
  31. To run a build, run gradle <task> ...
  32. To see a list of available tasks, run gradle tasks
  33. To see a list of command-line options, run gradle --help
  34. To see more detail about a task, run gradle help --task <task>
  35. For troubleshooting, visit https://help.gradle.org
  36. BUILD SUCCESSFUL in 9s
  37. 1 actionable task: 1 executed

遇见的错误

Received status code 401 from server: Unauthorized

解决办法:
settings.gradle修改
将第四行pluginManagement->repositories节点下的maven配置改为阿里云的镜像

  1. maven { url 'https://maven.aliyun.com/repository/public' }

POM relocation to an other version number is not fully supported in Gradle : xml-apis:xml-apis:2.0.2

解决办法:
build.gradle添加

  1. configurations.all {
  2. resolutionStrategy {
  3. force 'xml-apis:xml-apis:1.4.01'
  4. }
  5. }