折腾:
【记录】VSCode中参考java的官网教程确认调试环境配置是否正确
期间,此处,VSCode中进行Java开发,想要调试java代码,但是检测出一堆问题。还提示让去设置maven等内容。
说是,需要配置好项目才行。
但是此处,要去搞清楚:到底是用pom.xml 还是 build.gradle ?
点击前面的:Update Project Configuration
提示:
No Java project to update!
没有给出要的解释
好像推荐用maven,且看起来也简单方便够用
vscode debug java use pom.xml or build.gradle
vscode java which pom.xml build.gradle
官网中,也是貌似只提到了maven,没说gradle
也提到了:2016年的评论“+1. Maven has been all but replaced by Gradle on any new projects that I know of. Without Gradle support, the plugin is not really usable :-/”
而自己也依稀记得:之前有人说过,现在多数用gradle,而不用maven了。
安装Gradle
创建Gradle工程
注:此处不支持Android的gradle
vscode maven vs gradle
java maven vs gradle
还是gradle用起来清爽
【总结】
- Maven是pom.xml
- Gradle是:build.gradle
所以问题变成:
此处VSCode调试Java,用Maven还是Gradle
- Maven:用的最广,最多
- Gradle:新出来的,用起来清爽
- 和maven比这些做的更好:
- flexibility
- performance
- gradle支持增量编译incremental build
- Incremental compilations for Java classes
- Compile avoidance for Java
- The use of APIs for incremental subtasks
- A compiler daemon that also makes compiling a lot faster
- user experience
- dependency management
- gradle支持
- The use of substitution rules for compatible libraries
- The use of ReplacedBy rules
- Better metadata resolution
- The ability to dynamically replace project dependencies with external ones, and vice versa
自己暂时用:gradle的build.gradle
转载请注明:在路上 » 【已解决】VSCode中调试Java用maven的pom.xml还是gradle的build.gradle