浏览代码

Merge remote-tracking branch 'origin/master'

Menethil 7 年之前
父节点
当前提交
84afede401
共有 19 个文件被更改,包括 87 次插入125 次删除
  1. 1 1
      litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminRegionController.java
  2. 2 2
      litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminStorageController.java
  3. 1 8
      litemall-all/src/main/java/org/linlinjava/litemall/Application.java
  4. 6 27
      litemall-core/pom.xml
  5. 2 4
      litemall-core/src/main/java/org/linlinjava/litemall/core/qcode/QCodeService.java
  6. 5 5
      litemall-core/src/main/java/org/linlinjava/litemall/core/storage/AliyunStorage.java
  7. 3 3
      litemall-core/src/main/java/org/linlinjava/litemall/core/storage/LocalStorage.java
  8. 5 3
      litemall-core/src/main/java/org/linlinjava/litemall/core/storage/Storage.java
  9. 7 5
      litemall-core/src/main/java/org/linlinjava/litemall/core/storage/StorageService.java
  10. 5 8
      litemall-core/src/main/java/org/linlinjava/litemall/core/storage/TencentStorage.java
  11. 0 28
      litemall-core/src/main/java/org/linlinjava/litemall/core/util/YmlPropertyFactory.java
  12. 1 1
      litemall-core/src/main/resources/application.yml
  13. 3 3
      litemall-core/src/test/java/org/linlinjava/litemall/core/AliyunStorageTest.java
  14. 3 6
      litemall-core/src/test/java/org/linlinjava/litemall/core/LocalStorageTest.java
  15. 3 5
      litemall-core/src/test/java/org/linlinjava/litemall/core/TencentStorageTest.java
  16. 5 5
      litemall-db/pom.xml
  17. 1 1
      litemall-db/src/main/resources/application-db.yml
  18. 2 2
      litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxStorageController.java
  19. 32 8
      pom.xml

+ 1 - 1
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminRegionController.java

@@ -44,7 +44,7 @@ public class AdminRegionController {
                        String name, Integer code,
                        @RequestParam(defaultValue = "1") Integer page,
                        @RequestParam(defaultValue = "10") Integer limit,
-                       @Sort @RequestParam(defaultValue = "add_time") String sort,
+                       @Sort (accepts={"id"}) @RequestParam(defaultValue = "id") String sort,
                        @Order @RequestParam(defaultValue = "desc") String order){
         if(adminId == null){
             return ResponseUtil.unlogin();

+ 2 - 2
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminStorageController.java

@@ -68,7 +68,7 @@ public class AdminStorageController {
     }
 
     @PostMapping("/create")
-    public Object create(@LoginAdmin Integer adminId, @RequestParam("file") MultipartFile file) {
+    public Object create(@LoginAdmin Integer adminId, @RequestParam("file") MultipartFile file) throws IOException {
         if(adminId == null){
             return ResponseUtil.unlogin();
         }
@@ -81,7 +81,7 @@ public class AdminStorageController {
             return ResponseUtil.badArgumentValue();
         }
         String key = generateKey(originalFilename);
-        storageService.store(file, key);
+        storageService.store(file.getInputStream(), file.getSize(), file.getContentType(), key);
 
         String url = storageService.generateUrl(key);
         LitemallStorage storageInfo = new LitemallStorage();

+ 1 - 8
litemall-all/src/main/java/org/linlinjava/litemall/Application.java

@@ -3,8 +3,6 @@ package org.linlinjava.litemall;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.support.SpringBootServletInitializer;
 
 @SpringBootApplication(scanBasePackages = {
         "org.linlinjava.litemall",
@@ -13,12 +11,7 @@ import org.springframework.boot.web.support.SpringBootServletInitializer;
         "org.linlinjava.litemall.wx",
         "org.linlinjava.litemall.admin"})
 @MapperScan("org.linlinjava.litemall.db.dao")
-public class Application extends SpringBootServletInitializer {
-
-    @Override
-    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
-        return application.sources(Application.class);
-    }
+public class Application {
 
     public static void main(String[] args) throws Exception {
         SpringApplication.run(Application.class, args);

+ 6 - 27
litemall-core/pom.xml

@@ -18,31 +18,23 @@
         </dependency>
 
         <dependency>
-            <groupId>com.fasterxml.jackson.datatype</groupId>
-            <artifactId>jackson-datatype-jsr310</artifactId>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
         </dependency>
 
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context-support</artifactId>
-            <version>RELEASE</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.mail</groupId>
-            <artifactId>javax.mail</artifactId>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-json</artifactId>
         </dependency>
 
         <dependency>
             <groupId>com.github.qcloudsms</groupId>
             <artifactId>qcloudsms</artifactId>
-            <version>1.0.5</version>
         </dependency>
 
         <dependency>
             <groupId>com.qcloud</groupId>
             <artifactId>cos_api</artifactId>
-            <version>5.4.4</version>
             <exclusions>
                 <exclusion>
                     <artifactId>slf4j-log4j12</artifactId>
@@ -54,7 +46,6 @@
         <dependency>
             <groupId>com.aliyun.oss</groupId>
             <artifactId>aliyun-sdk-oss</artifactId>
-            <version>2.5.0</version>
             <exclusions>
                 <exclusion>
                     <artifactId>commons-lang</artifactId>
@@ -68,24 +59,12 @@
             <artifactId>weixin-java-miniapp</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-configuration-processor</artifactId>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
-            <groupId>org.linlinjava</groupId>
-            <artifactId>litemall-db</artifactId>
-        </dependency>
-        <dependency>
             <groupId>com.github.binarywang</groupId>
             <artifactId>weixin-java-pay</artifactId>
-            <version>3.0.0</version>
         </dependency>
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-test</artifactId>
-            <version>5.0.7.RELEASE</version>
-            <scope>compile</scope>
+            <groupId>org.linlinjava</groupId>
+            <artifactId>litemall-db</artifactId>
         </dependency>
     </dependencies>
 

+ 2 - 4
litemall-core/src/main/java/org/linlinjava/litemall/core/qcode/QCodeService.java

@@ -7,9 +7,7 @@ import org.linlinjava.litemall.core.system.SystemConfig;
 import org.linlinjava.litemall.db.domain.LitemallGroupon;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
-import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
 
 import javax.imageio.ImageIO;
 import java.awt.*;
@@ -65,9 +63,9 @@ public class QCodeService {
             FileInputStream inputStream = new FileInputStream(file);
             //将商品图片,商品名字,商城名字画到模版图中
             byte[] imageData = drawPicture(inputStream, goodPicUrl, goodName, SystemConfig.getMallName());
-            MultipartFile multipartFile = new MockMultipartFile(file.getName(), file.getName(), "image/jpeg", imageData);
+            ByteArrayInputStream inputStream2 = new ByteArrayInputStream(imageData);
             //存储分享图
-            storageService.store(multipartFile, getKeyName(goodId));
+            storageService.store(inputStream2, imageData.length, "image/jpeg", getKeyName(goodId));
         } catch (WxErrorException e) {
             e.printStackTrace();
         } catch (FileNotFoundException e) {

+ 5 - 5
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/AliyunStorage.java

@@ -6,8 +6,8 @@ import com.aliyun.oss.model.PutObjectRequest;
 import com.aliyun.oss.model.PutObjectResult;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.UrlResource;
-import org.springframework.web.multipart.MultipartFile;
 
+import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.file.Path;
@@ -74,14 +74,14 @@ public class AliyunStorage implements Storage {
      * 阿里云OSS对象存储简单上传实现
      */
     @Override
-    public void store(MultipartFile file, String keyName) {
+    public void store(InputStream inputStream, long contentLength, String contentType, String keyName) {
         try {
             // 简单文件上传, 最大支持 5 GB, 适用于小文件上传, 建议 20M以下的文件使用该接口
             ObjectMetadata objectMetadata = new ObjectMetadata();
-            objectMetadata.setContentLength(file.getSize());
-            objectMetadata.setContentType(file.getContentType());
+            objectMetadata.setContentLength(contentLength);
+            objectMetadata.setContentType(contentType);
             // 对象键(Key)是对象在存储桶中的唯一标识。
-            PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, keyName, file.getInputStream(), objectMetadata);
+            PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, keyName, inputStream, objectMetadata);
             PutObjectResult putObjectResult = getOSSClient().putObject(putObjectRequest);
         } catch (Exception ex) {
             ex.printStackTrace();

+ 3 - 3
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/LocalStorage.java

@@ -3,9 +3,9 @@ package org.linlinjava.litemall.core.storage;
 
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.UrlResource;
-import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -47,9 +47,9 @@ public class LocalStorage implements Storage {
     }
 
     @Override
-    public void store(MultipartFile file, String keyName) {
+    public void store(InputStream inputStream, long contentLength, String contentType, String keyName) {
         try {
-            Files.copy(file.getInputStream(), rootLocation.resolve(keyName), StandardCopyOption.REPLACE_EXISTING);
+            Files.copy(inputStream, rootLocation.resolve(keyName), StandardCopyOption.REPLACE_EXISTING);
         } catch (IOException e) {
             throw new RuntimeException("Failed to store file " + keyName, e);
         }

+ 5 - 3
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/Storage.java

@@ -1,8 +1,8 @@
 package org.linlinjava.litemall.core.storage;
 
 import org.springframework.core.io.Resource;
-import org.springframework.web.multipart.MultipartFile;
 
+import java.io.InputStream;
 import java.nio.file.Path;
 import java.util.stream.Stream;
 
@@ -13,10 +13,12 @@ public interface Storage {
 
     /**
      * 存储一个文件对象
-     * @param file      SpringBoot MultipartFile文件对象
+     * @param inputStream 文件输入流
+     * @param contentLength 文件长度
+     * @param contentType 文件类型
      * @param keyName   文件索引名
      */
-    void store(MultipartFile file, String keyName);
+    void store(InputStream inputStream, long contentLength, String contentType, String keyName);
 
     Stream<Path> loadAll();
 

+ 7 - 5
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/StorageService.java

@@ -3,6 +3,7 @@ package org.linlinjava.litemall.core.storage;
 import org.springframework.core.io.Resource;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.InputStream;
 import java.nio.file.Path;
 import java.util.stream.Stream;
 
@@ -31,12 +32,13 @@ public class StorageService {
 
     /**
      * 存储一个文件对象
-     *
-     * @param file    SpringBoot MultipartFile文件对象
-     * @param keyName 文件索引名
+     * @param inputStream 文件输入流
+     * @param contentLength 文件长度
+     * @param contentType 文件类型
+     * @param keyName   文件索引名
      */
-    public void store(MultipartFile file, String keyName) {
-        storage.store(file, keyName);
+    public void store(InputStream inputStream, long contentLength, String contentType, String keyName) {
+        storage.store(inputStream, contentLength, contentType, keyName);
     }
 
     public Stream<Path> loadAll() {

+ 5 - 8
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/TencentStorage.java

@@ -8,13 +8,10 @@ import com.qcloud.cos.model.ObjectMetadata;
 import com.qcloud.cos.model.PutObjectRequest;
 import com.qcloud.cos.model.PutObjectResult;
 import com.qcloud.cos.region.Region;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.PropertySource;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.UrlResource;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
 
+import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.file.Path;
@@ -81,14 +78,14 @@ public class TencentStorage implements Storage {
     }
 
     @Override
-    public void store(MultipartFile file, String keyName) {
+    public void store(InputStream inputStream, long contentLength, String contentType, String keyName) {
         try {
             // 简单文件上传, 最大支持 5 GB, 适用于小文件上传, 建议 20M以下的文件使用该接口
             ObjectMetadata objectMetadata = new ObjectMetadata();
-            objectMetadata.setContentLength(file.getSize());
-            objectMetadata.setContentType(file.getContentType());
+            objectMetadata.setContentLength(contentLength);
+            objectMetadata.setContentType(contentType);
             // 对象键(Key)是对象在存储桶中的唯一标识。例如,在对象的访问域名 `bucket1-1250000000.cos.ap-guangzhou.myqcloud.com/doc1/pic1.jpg` 中,对象键为 doc1/pic1.jpg, 详情参考 [对象键](https://cloud.tencent.com/document/product/436/13324)
-            PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, keyName, file.getInputStream(), objectMetadata);
+            PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, keyName, inputStream, objectMetadata);
             PutObjectResult putObjectResult = getCOSClient().putObject(putObjectRequest);
         } catch (Exception ex) {
             ex.printStackTrace();

+ 0 - 28
litemall-core/src/main/java/org/linlinjava/litemall/core/util/YmlPropertyFactory.java

@@ -1,28 +0,0 @@
-package org.linlinjava.litemall.core.util;
-
-import org.springframework.boot.env.PropertySourcesLoader;
-import org.springframework.core.env.PropertySource;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.EncodedResource;
-import org.springframework.core.io.support.PropertySourceFactory;
-
-import java.io.IOException;
-
-/**
- * 某些情况下外部依赖导致 yaml 配置未能正确注入时,@PropertySource(value = {"classpath:application-wx.yaml"}, factory = YmlPropertyFactory.class) 手动注入配置文件
- */
-public class YmlPropertyFactory implements PropertySourceFactory {
-    @Override
-    public PropertySource<?> createPropertySource(String name, EncodedResource resource) throws IOException {
-        return name != null ? new PropertySourcesLoader().load(resource.getResource(), name, null) : new PropertySourcesLoader().load(
-                resource.getResource(), getNameForResource(resource.getResource()), null);
-    }
-
-    private static String getNameForResource(Resource resource) {
-        String name = resource.getDescription();
-        if (!org.springframework.util.StringUtils.hasText(name)) {
-            name = resource.getClass().getSimpleName() + "@" + System.identityHashCode(resource);
-        }
-        return name;
-    }
-}

+ 1 - 1
litemall-core/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: core
+    active: core, db
   message:
     encoding: UTF-8
 

+ 3 - 3
litemall-core/src/test/java/org/linlinjava/litemall/core/AliyunStorageTest.java

@@ -11,6 +11,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 import org.springframework.test.context.web.WebAppConfiguration;
 import org.springframework.util.FileCopyUtils;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 
@@ -24,9 +25,8 @@ public class AliyunStorageTest {
     @Test
     public void test() throws IOException {
         String test = getClass().getClassLoader().getResource("litemall.png").getFile();
-        byte[] content =  (byte[])FileCopyUtils.copyToByteArray(new FileInputStream(test));
-        MockMultipartFile mockMultipartFile = new MockMultipartFile("litemall.png", "litemall.png", "image/png", content);
-        aliyunStorage.store(mockMultipartFile, "litemall.png");
+        File testFile = new File(test);
+        aliyunStorage.store(new FileInputStream(test), testFile.length(), "image/png", "litemall.png");
         Resource resource = aliyunStorage.loadAsResource("litemall.png");
         String url = aliyunStorage.generateUrl("litemall.png");
         System.out.println("test file " + test);

+ 3 - 6
litemall-core/src/test/java/org/linlinjava/litemall/core/LocalStorageTest.java

@@ -6,11 +6,9 @@ import org.linlinjava.litemall.core.storage.LocalStorage;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.core.io.Resource;
-import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 import org.springframework.test.context.web.WebAppConfiguration;
-import org.springframework.util.FileCopyUtils;
-
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 
@@ -24,9 +22,8 @@ public class LocalStorageTest {
     @Test
     public void test() throws IOException {
         String test = getClass().getClassLoader().getResource("litemall.png").getFile();
-        byte[] content =  (byte[])FileCopyUtils.copyToByteArray(new FileInputStream(test));
-        MockMultipartFile mockMultipartFile = new MockMultipartFile("litemall.png", "litemall.png", "image/jpeg", content);
-        localStorage.store(mockMultipartFile, "litemall.png");
+        File testFile = new File(test);
+        localStorage.store(new FileInputStream(test), testFile.length(), "image/png", "litemall.png");
         Resource resource = localStorage.loadAsResource("litemall.png");
         String url = localStorage.generateUrl("litemall.png");
         System.out.println("test file " + test);

+ 3 - 5
litemall-core/src/test/java/org/linlinjava/litemall/core/TencentStorageTest.java

@@ -6,11 +6,10 @@ import org.linlinjava.litemall.core.storage.TencentStorage;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.core.io.Resource;
-import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 import org.springframework.test.context.web.WebAppConfiguration;
-import org.springframework.util.FileCopyUtils;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 
@@ -24,9 +23,8 @@ public class TencentStorageTest {
     @Test
     public void test() throws IOException {
         String test = getClass().getClassLoader().getResource("litemall.png").getFile();
-        byte[] content =  (byte[])FileCopyUtils.copyToByteArray(new FileInputStream(test));
-        MockMultipartFile mockMultipartFile = new MockMultipartFile("litemall.png", "litemall.png", "image/png", content);
-        tencentStorage.store(mockMultipartFile, "litemall.png");
+        File testFile = new File(test);
+        tencentStorage.store(new FileInputStream(test), testFile.length(), "image/png", "litemall.png");
         Resource resource = tencentStorage.loadAsResource("litemall.png");
         String url = tencentStorage.generateUrl("litemall.png");
         System.out.println("test file " + test);

+ 5 - 5
litemall-db/pom.xml

@@ -13,6 +13,11 @@
     <dependencies>
 
         <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-json</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
         </dependency>
@@ -32,11 +37,6 @@
             <artifactId>druid-spring-boot-starter</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-        </dependency>
-
     </dependencies>
 
 

+ 1 - 1
litemall-db/src/main/resources/application-db.yml

@@ -22,5 +22,5 @@ spring:
       test-on-return:  false
       test-while-idle:  true
       time-between-eviction-runs-millis:  60000
-      filters:  stat,wall,log4j
+      filters:  stat,wall
 

+ 2 - 2
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxStorageController.java

@@ -48,7 +48,7 @@ public class WxStorageController {
     }
 
     @PostMapping("/upload")
-    public Object upload(@RequestParam("file") MultipartFile file) {
+    public Object upload(@RequestParam("file") MultipartFile file) throws IOException {
         String originalFilename = file.getOriginalFilename();
         InputStream inputStream = null;
         try {
@@ -58,7 +58,7 @@ public class WxStorageController {
             return ResponseUtil.badArgumentValue();
         }
         String key = generateKey(originalFilename);
-        storageService.store(file, key);
+        storageService.store(file.getInputStream(), file.getSize(), file.getContentType(), key);
 
         String url = storageService.generateUrl(key);
         LitemallStorage storageInfo = new LitemallStorage();

+ 32 - 8
pom.xml

@@ -9,7 +9,7 @@
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>1.5.12.RELEASE</version>
+        <version>2.0.4.RELEASE</version>
         <relativePath/>
     </parent>
 
@@ -55,12 +55,6 @@
                 <version>${project.version}</version>
             </dependency>
 
-            <dependency>
-                <groupId>com.fasterxml.jackson.datatype</groupId>
-                <artifactId>jackson-datatype-jsr310</artifactId>
-                <version>2.9.5</version>
-            </dependency>
-
             <!-- Spring Boot Mybatis 依赖 -->
             <dependency>
                 <groupId>org.mybatis.spring.boot</groupId>
@@ -85,7 +79,7 @@
             <dependency>
                 <groupId>com.alibaba</groupId>
                 <artifactId>druid-spring-boot-starter</artifactId>
-                <version>1.1.9</version>
+                <version>1.1.10</version>
             </dependency>
 
             <dependency>
@@ -99,6 +93,36 @@
                 <artifactId>weixin-java-miniapp</artifactId>
                 <version>3.1.0</version>
             </dependency>
+
+            <dependency>
+                <groupId>com.github.qcloudsms</groupId>
+                <artifactId>qcloudsms</artifactId>
+                <version>1.0.5</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.qcloud</groupId>
+                <artifactId>cos_api</artifactId>
+                <version>5.4.4</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.aliyun.oss</groupId>
+                <artifactId>aliyun-sdk-oss</artifactId>
+                <version>2.5.0</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-json</artifactId>
+                <version>2.0.4.RELEASE</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-mail</artifactId>
+                <version>2.0.4.RELEASE</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>