Windows
参考https://www.bilibili.com/video/av78474321/
准备
java jdk1.8
- 安装教程
- 配置环境变量
https://www.cnblogs.com/mr-wuxiansheng/p/6850437.html
maven apache-maven-3.6.3
- 建议放在用户权限的位置,有修改内容,保证有权限修改
- 配置环境变量
https://blog.csdn.net/u010782846/article/details/52775774
https://blog.csdn.net/qq_15872419/article/details/109080929
idea
community导入springboot项目会有问题。建议使用企业版(IU)
git
- 安装git
https://www.cnblogs.com/xueweisuoyong/p/11914045.html - git cmd中添加用户名和email(只用于日志标识)
git config --global user.name "name"
git config --global user.email "name@163.com"
https://www.cnblogs.com/javahr/p/9766371.html
- idea配置git
File->Settings->Version Control->Git
- path to git executable: git安装路径,点text测试出现版本号
C:\Program Files\Git\bin\git.exe
File->Settings->Tools->terminal
- Shell path:git安装路径
C:\Program Files\Git\git-cmd.exe
- idea下克隆项目
File->New->Project from Version Control…
->Repository URL->URL写项目clone的http地址,Diretory创建一个新的目录
maven修改
修改C:\Program Files\apache-maven-3.6.3\conf\settings.xml
- 配置jar包存放的repo
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>C:\Users\xx\repository</localRepository>
- 配置阿里云镜像,删掉原来的镜像
<!-- mirrors
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
| However, this repository may have problems with heavy traffic at times, so people have mirrored
| it to several places.
|
| That repository definition will have a unique id, so we can create a mirror reference for that
| repository, to be used as an alternate download site. The mirror site will be the preferred
| server for that repository.
|-->
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://central.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
配置java环境变量
略
配置idea
- 配置maven:
位置:File->Settings->Build,Execution,Deployment->Build Tools->Maven
修改Maven home path:自己的maven的位置
C:/Program Files/apache-maven-3.6.3
修改User settings file:maven的settings.xml的位置
C:\Program Files\apache-maven-3.6.3\conf\settings.xml
修改Local repository:settings.xml填写的repo地址。
C:\Users\xx\repository
-
配置jdk
位置:File->Project Structure->Platform Settings->SDKs
“+”,选JDK home path,加入1.8 -
配置项目jdk
位置:File->Project Structure->Project Settings->Project
修改Project SDK:1.8(没有的话检查下java有没有配好环境变量)
修改Project Language level: 选8
位置:File->Settings->Build,Execution,Deployment->Compiler->Java Compiler
修改Project bytecode version :8
- 配置编码
位置:File->Settings->Editor->File Encodings
修改Global Encoding、Project Encoding、Default encoding for properties files 都为UTF-8
导入项目
位置:File->New->Project from existing sources->选项目文件夹
选择import……,选maven
缺少maven依赖,执行(下依赖包用热点,不能用yf)
- idea:view->tool windows->maven窗口,项目的lifecycle->clean
- 执行
mvn install
或者
mvn clean install -Dcheckstyle.skip=true -Dmaven.javadoc.skip=true -DskipTests -Dmaven.test.failure.ignore=true
生成必要的api-target,此项不需要git push到远程仓库
- maven窗口,项目的右键reload project
或离线状态(第7个按钮)下,点最左边第一个按钮,reload all maven projects(解决netconf加载不出keystore的问题)
终极情况
试一下File->Invalidate Caches/Restart 清除缓存重启 还不行就maven -> Reinport
idea快捷键
-
获取提示
ctrl + space -
生成UML类图
ctrl + shift + alt + u