spring boot之pom文件中的依赖

作为一个开发人员,不要把代码粘过来直接用,最起码你也要知道你粘过来的代码是什么意思吧。下面简单的介绍一下spring boot项目中pom文件中的依赖
1.spring-boot-starter-parent

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.4.RELEASE</version>
    </parent>

该依赖可以从Starter Parent继承以获得一些默认配置,供以下功能:
Java 1.8作为默认编译器级别
UTF-8编码
从spring-boot-dependencies pom继承一些公共依赖的版本号,从而在使用这些依赖时不用配置项
自动resounce filter
自动plugin配置(exec, git)
自动读取配置文件application.properties和application.yml,包括application-dev.properties和application-dev.yml
2.spring-boot-starter-test
 作用:测试模块,包括JUnit、Hamcrest、Mockito。

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test</artifactId>
  <scope>test</scope>
</dependency>

3.spring-boot-maven-plugin
作用:在添加了该插件之后,当运行“mvn package”进行打包时,会打包成一个可以直接运行的JAR文件,使用"java -jar"命令就可以直接运行

build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

4.spring-boot-starter-web
作用:web的场景,自动帮我们引入了web模块开发需要的相关jar包
包含了嵌入式 tomcat 、 SpringMVC 必要组件

dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
</dependency>

5.spring-boot-starter
作用:Spring Boot的核心启动器,包含了自动配置、日志和YAML

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter</artifactId>
</dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

微微笑再加油

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值