我们知道在springboot中如果要使用springmvc等web功能,需要引入如下starter,

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

你可能会问,如果我想引入jdbc,想在springboot中引入mq相关的starter(前边已经说过就是jar包集合)该怎么写呢?也就是说有没有一个地方可以看到springboot的starter列表,有多少starters?可以参考下面这个网址:

https://docs.spring.io/spring-boot/docs/2.0.2.RELEASE/reference/htmlsingle/#using-boot-starter,如下图我截取了部分starter列表:

springboot里的starters

比如我想使用java mail方面的功能就可以找到使用的依赖是:

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-context</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-context-support</artifactId>
	</dependency>
	<dependency>
		<groupId>com.sun.mail</groupId>
		<artifactId>javax.mail</artifactId>
	</dependency>
</dependencies>

而我在项目里面只需写:

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

 

相关文章:

  • 2021-04-07
  • 2021-05-19
  • 2021-05-17
  • 2022-01-23
  • 2022-12-23
  • 2021-06-16
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2021-09-26
  • 2021-09-24
  • 2021-07-15
  • 2022-02-20
  • 2022-03-04
相关资源
相似解决方案