SpringBoot 一些简单的经验之谈

1、spring 不想加载数据库配置

Application 开头 加上 下面的注解
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

2、Sringboot的热部署的问题

1、CTRL + SHIFT + A --> 查找make project automatically --> 选中
这里写图片描述

2、首先CTRL + SHIFT + ALT +/ 点击注册

这里写图片描述

第二步 选择 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running //可能不太好找
这里写图片描述

3、pom 的代码:

	 <dependency>
	    <groupId>org.springframework.boot</groupId>
	    <artifactId>spring-boot-devtools</artifactId>
	    <optional>true</optional>
	</dependency>
	<plugin>
	    <groupId>org.springframework.boot</groupId>
	    <artifactId>spring-boot-maven-plugin</artifactId>
	    <configuration>
	        <fork>true</fork>
	    </configuration>
	</plugin>

猜你喜欢

转载自blog.csdn.net/weixin_42188064/article/details/82152416
今日推荐