SpringBoot中遇到的一些问题

1.热部署配置spring

除了要引一个节点windows

<!-- 能够实现热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>

能够实现热部署,在IDEA上实现热部署还需一些额外 的配置,配置过程以下:app

步骤1:打开idea ,File->Settings-> Build-Execution-Deployment -> Compiler--->勾选 Build Project Automatically.maven

步骤2: 按 Shift+Ctrl+A (windows,mac是 command+shift+A) 将看到弹窗 Enter Action or option name,输入"registry",双击第一项"Registry..." ,会弹出另外一个窗口,寻找 compiler.automake.allow.when.app.running 这一项,并勾选开启。而后关闭窗口。 ide

2.解决8080端口占用问题spring-boot

在dos下,输入 netstat -ano|findstr 8080ui

//说明:查看占用8080端口的进程idea

显示占用端口的进程插件

taskkill /pid 4708 /f命令行

//说明,运行windows自带taskkill命令,将上面显示的进程号, 结束掉。

3.使用命令行启动SpringBoot项目(要有maven环境)

(spring-boot-maven-plugin)插件

编译 mvn package   

启动 mvn spring-boot:run

编译效果

 

启动效果

相关文章
相关标签/搜索