spring-boot - 缺少 Spring Boot 依赖项“spring-integration-mail”
问题描述
在我的 Spring Boot ( 2.1.6.RELEASE
) 项目中,我添加了以下依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
但是仍然缺少以下内容spring-integration-mail
,不应该自动包含吗?
完整的 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.test.sample</groupId>
<artifactId>myproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>email-ci-trigger</name>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
解决方案
集成启动器只拉入spring-integration-core
罐子;否则你的类路径上会有很多不必要的 jar,从而减慢应用程序的启动速度。
邮件启动器对 Spring 集成一无所知;它适用于您想在没有弹簧集成的情况下使用邮件
您需要手动添加其他集成模块:
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-mail</artifactId>
</dependency>
将为您管理版本。
推荐阅读
- unix - 如何在 zip (Linux) 中获取文件名和总数
- node.js - Bot框架(nodejs v4)在Fb消息上的提示位置
- javascript - 是的,如何验证空对象上的必填字段
- db2 - DB2:需要提取分隔符左侧的字符串
- reactjs - 无法从 npm 安装 reactstrap
- windows-installer - 使用 NSIS 安装在 ProgramData 文件夹中
- tensorflow - TensorFlow v1 和 v2 中 Keras 的 ZeroPadding2D 的区别?
- authentication - cakephp 4 - 烘焙新控制器时找不到身份验证组件
- r - 可分配性图 - 绘制属于三个组的概率
- python - 从字典中提取相应键的值