| |
| |
| org.gradle.jvmargs=-Dfile.encoding=UTF-8 |
| |
| -Dfile.encoding=UTF-8 |
| |
| Q1:新建一个gradle项目,将其作为父工程,父工程中有src目录;在此之上新建子模块时使用spring boot快速构建,那么该子模块不会与父工程关联 |
| A1:新建父工程或子模块都应该使用gradle构建 |


| Q2:编译时报错:Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). The current version is |
| A2:尝试修改为可以用的版本 |

| Q3:编译时报错:A problem occurred evaluating root project ‘xxxxx‘. |
| A3:错误原因如下: |
| 例如在父工程的build.gradle中有如下配置 |
| |
| plugins { |
| id 'java' |
| id 'org.springframework.boot' version '2.4.0' |
| id 'io.spring.dependency-management' version '1.0.11.RELEASE' |
| } |
| |
| subprojects { |
| |
| apply plugin: 'java' |
| apply plugin: 'org.springframework.boot' |
| apply plugin: 'io.spring.dependency-management' |
| } |
| |
| # 如果将plugins中的id 'org.springframework.boot' version '2.4.0'注释了,那么subprojects中的apply plugin: 'org.springframework.boot'就会找不到,导致报如上的错误 |
| Q4:编译时报错:Circular dependency between the following tasks. |
| A4:相互依赖导致的报错 |
| 例如在父工程中引入了公共模块编译后的包 |
| dependencies { |
| implementation project(':common-api') |
| } |
| 而公共模块作为子模块又依赖于父工程 |
| 解决方案就是让其中一方不依赖于另一方 |
| 参考:https://blog.csdn.net/qq_32136827/article/details/109847008 |
| Q5:编译时报错:[ERROR]all buildscript {} blocks must appear before any plugins {} blocks in the script |
| A5:buildscript块必须出现在plugins块之前 |
| 参考:https: |
| Q6:gradle中某些依赖无法导入,呈灰色显示:No candidates found for method call mavenBom. |
| 解决方案:本地安装的gradle版本确保与idea中的gradle版本一致 |

- gardle运行main方法报错:
finshed with non-zero wxit value 1


· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术
2021-07-22 ubuntu入门