其他
Spring Boot 如何快速改造老项目?
1
前言碎语
2
老项目情况
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
</dependencies>
第二步:新增spring boot启动类,加载原先的xml配置
/**
* Created by kl on 2018/1/29.
* Content :Lbt-service-ext服务启动器
*/ (exclude = {RabbitAutoConfiguration.class}) ("service-context.xml")publicclassLbtServiceExtApplication{
publicstaticvoid main(String[] args) {
SpringApplication application= newSpringApplication(LbtServiceExtApplication.class);
application.setWebEnvironment(false);
application.run(args);
}}
可以代替mvn dependency:tree命令的使用了,这个插件可以更直观的列出项目依赖的jar,非常牛逼的是可以直接列出项目中有冲突的jar,这对找jar冲突非常有用,而且可以直接右键排除掉。
3
Spring Boot怎么识别web项目
来源:KL博客
http://www.kailing.pub/article/index/arcid/188.html
- END -
推荐阅读:点击「阅读原文」带你飞~