intellij+springboot+springloaded 实现热部署
来源:互联网 发布:zbrush4r7 mac版 破解 编辑:程序博客网 时间:2024/06/05 23:43
依赖:
dependencys目录下增加:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>
project 节点下添加:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <!-- spring热部署--> <dependency> <groupId>org.springframework</groupId> <artifactId>springloaded</artifactId> <version>1.2.1.RELEASE</version> </dependency> </dependencies> </plugin> </plugins></build>
java图 :
Application.java
import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.EnableAutoConfiguration;import org.springframework.context.ApplicationContext;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import java.util.Arrays;/** * Created by Administrator on 2015/2/10. */@Configuration@EnableAutoConfiguration@ComponentScanpublic class Application { public static void main(String [] m){ ApplicationContext ctx = SpringApplication.run(Application.class, m); System.out.println("Let's inspect the beans provided by Spring Boot:"); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { // System.out.println(beanName); } }}
controller.java
package hello;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;/** * Created by on 2015/2/15. */@RestControllerpublic class MyController { @RequestMapping("/thing") public MyThing thing() { MyThing m = new MyThing() ; m.setId("5"); m.setName("姓名"); return m ; } @RequestMapping("/thing2") public MyThing thing2() { MyThing m = new MyThing() ; m.setId("5"); m.setName("姓名"); return m ; }mything.java
package hello;/** * Created by hongpf on 2015/2/15. */public class MyThing { public String getId() { return id; } public void setId(String id) { this.id = id; } /** * */ String id ; public String getName() { return name; } public void setName(String name) { this.name = name; } String name ;}
当系统通过 mvn spring-boot:run启动或者 右键application debug 启动java文件时,系统会监视classes文件,当有classes文件被改动时,系统会重新加载类文件,不用重启启动服务
ps:需要重新编译文件 ctl+shift+f9
1 0
- intellij+springboot+springloaded 实现热部署
- intellij+springboot+springloaded 实现热部署
- SpringBoot+SpringLoaded热部署
- IntelliJ IDEA+springloaded热部署
- eclipse配置springloaded实现热部署
- IntelliJ IDEA中实现SpringBoot热部署
- Intellij-SpringBoot热部署
- springloaded热部署
- spring-boot中使用springloaded实现热部署
- SpringBoot项目在IntelliJ IDEA中实现热部署
- SpringBoot项目在IntelliJ IDEA中实现热部署
- SpringBoot项目在IntelliJ IDEA中实现热部署
- SpringBoot项目在IntelliJ IDEA中实现热部署
- SpringBoot项目在intellij idea中实现热部署
- SpringBoot项目在IntelliJ IDEA中实现热部署
- SpringBoot项目在IntelliJ IDEA中实现热部署
- SpringBoot项目在IntelliJ IDEA中实现热部署
- SpringBoot项目在IntelliJ IDEA中实现热部署
- 新年马上到,新年快乐!
- Codeforces Round #291 (Div. 2)解题报告A.B.C.D.E
- 互联网协议入门(一)
- pk10
- Base64算法C语言实现
- intellij+springboot+springloaded 实现热部署
- codeforces 67C Sequence of Balls (dp)
- php正则 贪婪模式与懒惰模式
- rc4算法C语言实现
- wait()与notify()/notifyAll()
- Matlab 仿真BPSK调制下传输的误码率
- hdu_1166 敌兵布阵
- C++框架
- eclipse的adt+sdk配置