IDEA创建运行部署(二)

1.创建工程
1.1.使用idea可以创建我们目前所知的所有框架,请见下图
可以创建如下几种框架的模板项目
下面演示创建 java web,maven,spring mvc 项目
java web创建
java web创建
maven项目创建

2.tomcat部署
2.1创建发布实例
2.2 使用tomcat发布
2.2.1 创建本地tomcat
2.2.2引入要发布的实例
2.2.3 热部署(改动代码而不需要重启)
Server-- 选择update class and resouces


3.spring boot热部署(修改后不用重启直接生效)


3.1.ctrl+Shift+Alt+/-----> 选择Registry ------>勾选

compiler.automake.allow.when.app.running


3.2.如果你进行上面的设置没有作用,请在检查下面图片的设置

Setting--->Compiler--->勾选Build project automatically



3.3 maven 加入依赖

<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> <!-- 如果没有该配置,devtools不会生效 -->
   </configuration>
</plugin>

扫描二维码关注公众号,回复: 1885699 查看本文章


猜你喜欢

转载自blog.csdn.net/robinsonxiao/article/details/80922641