Maven依赖一直报红
- 找组内同事要 settings 文件
- 找公司负责维护内部中心仓的部门支撑,根据id添加仓库地址。(很好用)
settings 文件注意事项:
- 有的依赖不是配成 repository 而是要配成 pluginRepository
Maven 好用的指令
- -U :可以要求必须重新联网拉依赖,不使用本地文件夹内的
- -s “你的settings文件路径” :有几次我更换了 settings 文件没有生效,ui界面的按钮点着很痛苦,在idea的terminal里面采用命令行执行该命令,就可以强制使用输入的路径对应的settings
装新的 IDEA 后若要修改编码:
1、File => Settings => Editor => File Encodings
把里面的三个Encoding都改成 UTF-8, 最下面的选择 NO BOM。
(如果Maven构建一直有 [ERROR] Malformed \uxxxx encoding. 可以删除本地仓库文件夹下面的path-to-the-library或者resolver-status.properties 文件)(everything这个软件很好用)
2、File->Other Settings->Default Settings ->Editor->File Encodings
3、将项目中的.idea文件夹中的encodings.xml文件中的编码格式改为uft-8
4、File->Settings->Build,Execution,Deployment -> Compiler -> Java Compiler
设置 Additional command line parameters选项为 -encoding utf-8
5、1) 打开Run/Debug Configuration,选择你的tomcat
2) 然后在 Server > VM options 设置为 -Dfile.encoding=UTF-8 ,重启tomcat