idea的一些使用经验

导入项目

1.在本地导入项目:File --> New --> Project from Existing Sources…
2.从git中下载:File --> New --> Project from Version Control --> Git

如果导入项目后maven文件不全

进入pom.xml --> 右键 --> 从新载入pom

启动项目

点击Run --> Edit Configurations --> +号 --> 选择你使用的sdk(如果是spring boot就选spring boot,maven就选maven)

idea热部署

1.添加依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>

2.设置:
file ==> setting ==> Build,Execution,Deployment ==> Compiler ==> 在Make project automatically选项上打勾
3.Shift+Ctrl+Alt+/ 选择 Registry
弹出的面板中找到:compiler.automake.allow.when.app.running 打勾
4.重启
注意:如果这样配置还是没变,是因为和springboot版本有关,需要在springboot配置文件(yml文件)中添加:

spring:
  devtools:
      restart:
	    #需要实时更新的目录
        additional-paths: resources/**,static/**,templates/**

idea安装lombok

1.file ==> Setting ==> Plugins
2.搜索lombok,选择Lombok plugin并且安装
3.pom文件中添加依赖

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.6</version>
    <scope>provided</scope>
</dependency>

4.直接在bean上使用@Getter等注解就可以了

git在idea中使用

1.首先,使用git bash,使用cd命令进入你想下载到的文件夹
2.通过git clone (+地址)进行项目的下载
3.idea中,首先需要配置git
(1)配置你需要使用的用户名和密码,File --> Settings… --> github --> 输入用户名密码,点Test,测试通过即可
(2)配置git地址,File --> Settings… --> git --> Path to Git executable:地址(地址为Git安装地址的bin下的git.exe),如:C:\Program Files\Git\bin\git.exe
4.讲刚刚使用git bash下载的项目导入到idea中,这样就可以直接在idea中使用push和pull了

发布了22 篇原创文章 · 获赞 0 · 访问量 1016

猜你喜欢

转载自blog.csdn.net/weixin_43119903/article/details/94719058