当前位置:   article > 正文

gradle编译spring源码过程问题整理_a problem occurred configuring root project 'sprin

a problem occurred configuring root project 'spring'. > could not resolve al

最近在看spring boot ,发现好多是spring中的技术或概念,于是找了一本书《Spring源码深度解析.pdf》,开始学习下源码是从git上下的,先把https://github.com/spring-projects/spring-framework  克隆成我的项目,然后为了节省时间,下载zip的方式下载到本地,接下来就是导入到开发工具eclipse了,


在cmd执行:gradle cleanidea eclipse时,报如下错误:

  1. FAILURE: Build failed with an exception.
  2. * What went wrong:
  3. A problem occurred configuring root project 'spring'.
  4. > Could not resolve all dependencies for configuration ':classpath'.
  5. > Could not resolve org.springframework.build.gradle:propdeps-plugin:0.0.7.
  6. Required by:
  7. :spring:4.2.3.BUILD-SNAPSHOT
  8. > Could not resolve org.springframework.build.gradle:propdeps-plugin:0.0.7.
  9. > Could not get resource 'https://repo.spring.io/plugins-release/org/springframework/build/gradle/propdeps-plugin/0.0.7/propdeps-plugin-0.0.7.pom'.
  10. > Could not GET 'https://repo.spring.io/plugins-release/org/springframework/build/gradle/propdeps-plugin/0.0.7/propdeps-plugin-0.0.7.pom'.
  11. > Connect to repo.spring.io:443 [repo.spring.io/35.186.232.213] failed: Connection timed out: connect
  12. * Try:
  13. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  14. BUILD FAILED


在这篇文章中找到,需要修改maven仓库:https://www.oschina.net/question/2380402_2181441

修改maven仓库

repositories { maven { url "http://repo.springsource.org/plugins-release" } }


以为是要修改maven的配置文件,结果找了半天,在https://blog.csdn.net/javandroid/article/details/75094335?locationNum=1&fps=1文章中发现是要修改项目下的build.gradle文件,

修改之

找到目录下的文件


打开文件修改。


修改完文件,保存,再执行命令,则发现构建成功,

  1. C:\burns\spring-framework-master\spring-tx>gradle cleanidea eclipse
  2. :buildSrc:clean
  3. :buildSrc:compileJava UP-TO-DATE
  4. :buildSrc:compileGroovy
  5. :buildSrc:processResources
  6. :buildSrc:classes
  7. :buildSrc:jar
  8. :buildSrc:assemble
  9. :buildSrc:compileTestJava UP-TO-DATE
  10. :buildSrc:compileTestGroovy UP-TO-DATE
  11. :buildSrc:processTestResources UP-TO-DATE
  12. :buildSrc:testClasses UP-TO-DATE
  13. :buildSrc:test UP-TO-DATE
  14. :buildSrc:check UP-TO-DATE
  15. :buildSrc:build
  16. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/fop/0.95-1/fop-0.95-1.jar
  17. Download https://repo.spring.io/plugins-release/org/apache/avalon/framework/avalon-framework-api/4.3.1/avalon-framework-api-4.3.1.jar
  18. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-util/1.7/batik-util-1.7.jar
  19. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-svg-dom/1.7/batik-svg-dom-1.7.jar
  20. Download https://repo.spring.io/plugins-release/net/sf/docbook/docbook-xsl/1.78.1/docbook-xsl-1.78.1-resources.zip
  21. Download https://repo.spring.io/plugins-release/net/sf/docbook/docbook-xml/5.0/docbook-xml-5.0-xsd-resources.zip
  22. Download https://repo.spring.io/plugins-release/net/sf/xslthl/xslthl/2.0.1/xslthl-2.0.1.jar
  23. Download https://repo.spring.io/plugins-release/org/apache/xerces/resolver/2.9.1/resolver-2.9.1.jar
  24. Download https://repo.spring.io/plugins-release/net/sf/docbook/docbook-xsl-saxon/1.0.0/docbook-xsl-saxon-1.0.0.jar
  25. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-gvt/1.7/batik-gvt-1.7.jar
  26. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-parser/1.7/batik-parser-1.7.jar
  27. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-script/1.7/batik-script-1.7.jar
  28. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-transcoder/1.7/batik-transcoder-1.7.jar
  29. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-extension/1.7/batik-extension-1.7.jar
  30. Download https://repo.spring.io/plugins-release/commons-io/commons-io/1.3.1/commons-io-1.3.1.jar
  31. Download https://repo.spring.io/plugins-release/org/apache/avalon/framework/avalon-framework-impl/4.3.1/avalon-framework-impl-4.3.1.jar
  32. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-js/1.7/batik-js-1.7.jar
  33. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/batik-svggen/1.7/batik-svggen-1.7.jar
  34. Download https://repo.spring.io/plugins-release/org/apache/xmlgraphics/xmlgraphics-commons/1.3.1/xmlgraphics-commons-1.3.1.jar
  35. The 'sonar-runner' plugin has been deprecated and is scheduled to be removed in Gradle 3.0. please use the official plugin from SonarQube (http://docs.sonarqube.org/display/SONAR/Analyzing+with+Gradle).
  36. :spring-tx:cleanIdeaModule UP-TO-DATE
  37. :spring-tx:cleanIdea UP-TO-DATE
  38. :spring-tx:eclipseClasspath
  39. Download https://repo.spring.io/libs-release/net/java/jvnet-parent/3/jvnet-parent-3.pom
  40. Download https://repo.spring.io/libs-release/javax/resource/connector-api/1.5/connector-api-1.5.pom
  41. Download https://repo.spring.io/libs-release/com/ibm/websphere/uow/6.0.2.17/uow-6.0.2.17.pom
  42. Download https://repo.spring.io/libs-release/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.pom
  43. Download https://repo.spring.io/libs-release/org/aspectj/aspectjweaver/1.8.7/aspectjweaver-1.8.7.pom
  44. Download https://repo.spring.io/libs-release/org/eclipse/persistence/javax.persistence/2.0.0/javax.persistence-2.0.0.pom
  45. Download https://repo.spring.io/libs-release/org/apache/apache/13/apache-13.pom
  46. Download https://repo.spring.io/libs-release/javax/resource/connector-api/1.5/connector-api-1.5.jar
  47. Download https://repo.spring.io/libs-release/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar
  48. Download https://repo.spring.io/libs-release/com/ibm/websphere/uow/6.0.2.17/uow-6.0.2.17.jar
  49. Download https://repo.spring.io/libs-release/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar
  50. Download https://repo.spring.io/libs-release/org/aspectj/aspectjweaver/1.8.7/aspectjweaver-1.8.7.jar
  51. Download https://repo.spring.io/libs-release/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2-sources.jar
  52. Download https://repo.spring.io/libs-release/javax/resource/connector-api/1.5/connector-api-1.5-sources.jar
  53. Download https://repo.spring.io/libs-release/javax/ejb/ejb-api/3.0/ejb-api-3.0-sources.jar
  54. Download https://repo.spring.io/libs-release/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19-sources.jar
  55. Download https://repo.spring.io/libs-release/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3-sources.jar
  56. Download https://repo.spring.io/libs-release/org/aspectj/aspectjweaver/1.8.7/aspectjweaver-1.8.7-sources.jar
  57. Download https://repo.spring.io/libs-release/org/eclipse/persistence/javax.persistence/2.0.0/javax.persistence-2.0.0-sources.jar
  58. Download https://repo.spring.io/libs-release/org/objenesis/objenesis/2.1/objenesis-2.1-sources.jar
  59. :spring-tx:eclipseJdtPrepare
  60. :spring-tx:eclipseJdt
  61. :spring-tx:eclipseProject
  62. :spring-tx:eclipseSettings
  63. :spring-tx:eclipseWstComponent
  64. :spring-tx:eclipse
  65. BUILD SUCCESSFUL
  66. Total time: 1 mins 55.201 secs
  67. C:\burns\spring-framework-master\spring-tx>

在观察spring-tx目录下就变成eclipse可以导入的带.project和.classpath文件的项目目录了。


导入eclipse,剩下的项目感叹号❗的问题就继续阅读pdf解决吧。


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/288951?site
推荐阅读
相关标签
  

闽ICP备14008679号