方式一:layui签到导入导出
    layui第三方插件地址:https://fly.layui.com/jie/47273/ http://excel.wj2015.com/_book/

    jsp页面:
    jquery-1.11.3.min.js
    layui.js
    excel.js

    1. <%--
    2. Created by IntelliJ IDEA.
    3. User: jiaming
    4. Date: 2019/12/31
    5. Time: 12:34
    6. To change this template use File | Settings | File Templates.
    7. --%>
    8. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    9. <html>
    10. <head>
    11. <title>excel导入导出</title>
    12. <!--先加载jquery-->
    13. <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
    14. <script src="layui_new/layui/layui.js" charset="utf-8"></script>
    15. <!--再加载插件-->
    16. <script src="layui_exts/excel.js" charset="utf-8"></script>
    17. <script type="text/javascript">
    18. $(function () {
    19. layui.config({
    20. base: 'layui_exts/'
    21. }).extend({
    22. excel: 'excel'
    23. });
    24. // LAY_EXCEL.exportExcel([[1, 2, 3]], '表格导出.xlsx', 'xlsx');
    25. layui.use(['jquery', 'excel', 'layer'], function () {
    26. var $ = layui.jquery;
    27. var excel = layui.excel;
    28. $.ajax({
    29. url: '/path/to/get/data',
    30. dataType: 'json',
    31. success: function (res) {
    32. // 假如返回的 res.data 是需要导出的列表数据
    33. console.log(res.data);// [{name: 'wang', age: 18, sex: '男'}, {name: 'layui', age: 3, sex: '女'}]
    34. // 1. 数组头部新增表头
    35. res.data.unshift({name: '用户名', sex: '男', age: '年龄'});
    36. // 2. 如果需要调整顺序,请执行梳理函数
    37. var data = excel.filterExportData(res.data, [
    38. 'name',
    39. 'sex',
    40. 'age',
    41. ]);
    42. // 3. 执行导出函数,系统会弹出弹框
    43. excel.exportExcel({
    44. sheet1: data
    45. }, '导出接口数据.xlsx', 'xlsx');
    46. }
    47. });
    48. // 监听上传文件的事件
    49. $('#LAY-excel-import-excel').change(function (e) {
    50. var files = e.target.files;
    51. try {
    52. // 方式一:先读取数据,后梳理数据
    53. excel.importExcel(files, {}, function (data) {
    54. console.log(data);
    55. data = excel.filterImportData(data, {
    56. 'id': 'A'
    57. , 'username': 'B'
    58. , 'experience': 'C'
    59. , 'sex': 'D'
    60. , 'score': 'E'
    61. , 'city': 'F'
    62. , 'classify': 'G'
    63. , 'wealth': 'H'
    64. , 'sign': 'I'
    65. })
    66. console.log(data);
    67. });
    68. // 方式二:可以在读取过程中梳理数据
    69. excel.importExcel(files, {
    70. fields: {
    71. 'id': 'A'
    72. , 'username': 'B'
    73. , 'experience': 'C'
    74. , 'sex': 'D'
    75. , 'score': 'E'
    76. , 'city': 'F'
    77. , 'classify': 'G'
    78. , 'wealth': 'H'
    79. , 'sign': 'I'
    80. }
    81. }, function (data) {
    82. console.log(data);
    83. });
    84. } catch (e) {
    85. layer.alert(e.message);
    86. }
    87. });
    88. });
    89. });
    90. </script>
    91. </head>
    92. <body>
    93. <input type="file" class="layui-btn layui-btn-primary" id="LAY-excel-import-excel" multiple="multiple">
    94. </body>
    95. </html>

    方式二:poi后端导入,layui前端导出
    **
    前台jsp:
    jquery-1.11.3.min.js
    public.js

    1. <%--
    2. Created by IntelliJ IDEA.
    3. User: jiaming
    4. Date: 2020/1/1
    5. Time: 12:05
    6. To change this template use File | Settings | File Templates.
    7. --%>
    8. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    9. <html>
    10. <head>
    11. <title>后台实现excel导入操作</title>
    12. <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
    13. <script type="text/javascript" src="js/public.js"></script>
    14. </head>
    15. <body>
    16. <script>
    17. function submit3() {
    18. // ajax里面将参数自动转换为json格式,所以后台接收必须用"@RequestBody"接收
    19. doUploadFile("TestExcel/addExcel","myForm", function (data) {
    20. console.log(data);
    21. });
    22. }
    23. </script>
    24. <form id="myForm">
    25. 请选择上传的excel文件:
    26. <input type="file" name="file">
    27. 额外参数:
    28. <input type="text" name="name">
    29. <input type="button" value="提交" onclick="submit3();">
    30. </form>
    31. </body>
    32. </html>

    后端java:
    控制层

    1. package jxxdxy.controller;
    2. import jxxdxy.model.Back;
    3. import jxxdxy.model.Result;
    4. import jxxdxy.model.TestFile;
    5. import jxxdxy.util.ExcelUtil;
    6. import org.apache.poi.ss.usermodel.Cell;
    7. import org.apache.poi.ss.usermodel.Row;
    8. import org.springframework.stereotype.Controller;
    9. import org.springframework.web.bind.annotation.RequestMapping;
    10. import org.springframework.web.bind.annotation.ResponseBody;
    11. import org.springframework.web.multipart.MultipartFile;
    12. import org.springframework.web.multipart.MultipartHttpServletRequest;
    13. import javax.servlet.http.HttpServletRequest;
    14. import java.io.InputStream;
    15. import java.util.List;
    16. @Controller
    17. @RequestMapping("TestExcel")
    18. public class TestExcel {
    19. @RequestMapping("addExcel")
    20. @ResponseBody
    21. public Back addFile(TestFile file, HttpServletRequest request){
    22. System.out.println("接收的对象:"+file);
    23. System.out.println(file.getFile().getOriginalFilename()+"--"+file.getFile().getSize());
    24. Back back = new Back();
    25. MultipartFile excl = file.getFile();
    26. if (request instanceof MultipartHttpServletRequest) {
    27. //说明文件不为空
    28. if (!excl.isEmpty()) {
    29. try {
    30. String fileName = excl.getOriginalFilename();
    31. //转化为流的形式
    32. InputStream is = excl.getInputStream();
    33. List<Row> list = ExcelUtil.getExcelRead(fileName, is, true);
    34. //首先是读取行 也就是一行一行读,然后在取到列,遍历行里面的行,根据行得到列的值
    35. for (Row row : list) {
    36. Cell cell_0 = row.getCell(0);
    37. System.out.println(ExcelUtil.getValue(cell_0));
    38. //得到每个元素的值start
    39. // Cell cell_0 = row.getCell(0);
    40. // Cell cell_1 = row.getCell(1);
    41. // Cell cell_2 = row.getCell(2);
    42. // Cell cell_3 = row.getCell(3);
    43. // Cell cell_4 = row.getCell(4);
    44. // //得到列的值,也就是你需要解析的字段的值
    45. // String name = ExcelUtil.getValue(cell_0);
    46. // String nickName = ExcelUtil.getValue(cell_1);
    47. // String phone = ExcelUtil.getValue(cell_2);
    48. // String actorName = ExcelUtil.getValue(cell_3);
    49. // String status = ExcelUtil.getValue(cell_4);
    50. // String regex = "^1[3|4|5|8][0-9]\\d{8}$";
    51. // if ("".equals(name)){
    52. // result.setSuccess(false);
    53. // result.setErrorMessage("第"+(row.getRowNum())+"行第"+1+"列的姓名不能为空!");
    54. // return result;
    55. // } else if (!(phone.matches(regex))){
    56. // result.setSuccess(false);
    57. // result.setErrorMessage("第"+(row.getRowNum())+"行第" +3+ "列的手机号码格式不正确");
    58. // return result;
    59. // } else if("".equals(actorName)){
    60. // result.setSuccess(false);
    61. // result.setErrorMessage("第"+(row.getRowNum())+"行第"+5+"列的角色名不能为空!");
    62. // return result;
    63. // } else if("".equals(status)) {
    64. // result.setSuccess(false);
    65. // result.setErrorMessage("第"+(row.getRowNum())+"行第" + 6 + "列的状态不能为空!");
    66. // return result;
    67. // }else if (!("启用".equals(status)) || ("禁用".equals(status))){
    68. // result.setSuccess(false);
    69. // result.setErrorMessage("第"+(row.getRowNum())+"行第" + 6 + "列的状态只能为启用或禁用");
    70. // return result;
    71. // }
    72. }
    73. System.out.println("预览成功");
    74. back.setCode(0);
    75. back.setMsg("表格数据预览");
    76. } catch (Exception e) {
    77. e.printStackTrace();
    78. System.out.println("预览出现异常");
    79. back.setCode(0);
    80. back.setMsg("预览失败,预览出现异常");
    81. }
    82. } else {
    83. System.out.println("预览失败,文件为空");
    84. back.setCode(0);
    85. back.setMsg("预览失败,文件为空");
    86. }
    87. }
    88. return back;
    89. }
    90. }

    模型层

    1. package jxxdxy.model;
    2. import org.springframework.web.multipart.MultipartFile;
    3. import java.util.Arrays;
    4. public class TestFile {
    5. private String name;//额外参数
    6. private MultipartFile file;//上传文件
    7. private MultipartFile[] files;//上传多个文件
    8. @Override
    9. public String toString() {
    10. return "TestFile{" +
    11. "name='" + name + '\'' +
    12. ", file=" + file +
    13. ", files=" + Arrays.toString(files) +
    14. '}';
    15. }
    16. public String getName() {
    17. return name;
    18. }
    19. public void setName(String name) {
    20. this.name = name;
    21. }
    22. public MultipartFile getFile() {
    23. return file;
    24. }
    25. public void setFile(MultipartFile file) {
    26. this.file = file;
    27. }
    28. public MultipartFile[] getFiles() {
    29. return files;
    30. }
    31. public void setFiles(MultipartFile[] files) {
    32. this.files = files;
    33. }
    34. }

    帮助类

    1. package jxxdxy.util;
    2. import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    3. import org.apache.poi.ss.usermodel.Cell;
    4. import org.apache.poi.ss.usermodel.Row;
    5. import org.apache.poi.ss.usermodel.Sheet;
    6. import org.apache.poi.ss.usermodel.Workbook;
    7. import org.apache.poi.xssf.usermodel.XSSFWorkbook;
    8. import java.io.InputStream;
    9. import java.math.BigDecimal;
    10. import java.util.ArrayList;
    11. import java.util.List;
    12. /**
    13. * @author huwei
    14. */
    15. public class ExcelUtil {
    16. /**
    17. * 获取解析文件行数据
    18. * @param fileName : 文件地址
    19. * @param isTitle : 是否过滤第一行解析
    20. * @return
    21. * @throws Exception
    22. */
    23. public static List<Row> getExcelRead(String fileName, InputStream is, boolean isTitle) throws Exception{
    24. try {
    25. //判断其兼容版本 调用了判断版本的方法
    26. Workbook workbook = getWorkbook(fileName,is);
    27. Sheet sheet = workbook.getSheetAt(0);
    28. int count = 0;
    29. List<Row> list = new ArrayList<Row>();
    30. for (Row row : sheet) {
    31. // 跳过第一行的目录
    32. if (count == 0 && isTitle) {
    33. count++;
    34. continue;
    35. }
    36. list.add(row);
    37. }
    38. return list;
    39. } catch (Exception e) {
    40. throw e;
    41. }
    42. }
    43. /**判断版本的方法*/
    44. public static Workbook getWorkbook(String fileName,InputStream is) throws Exception{
    45. Workbook workbook = null;
    46. try {
    47. /** 判断文件的类型,是2003还是2007 */
    48. boolean isExcel2003 = true;
    49. if (WDWUtil.isExcel2007(fileName)) {
    50. isExcel2003 = false;
    51. }
    52. if (isExcel2003) {
    53. workbook = new HSSFWorkbook(is);
    54. } else {
    55. workbook = new XSSFWorkbook(is);
    56. }
    57. } catch (Exception e) {
    58. throw e;
    59. }
    60. return workbook;
    61. }
    62. /**得到celL值的方法:*/
    63. public static String getValue(Cell cell){
    64. if (cell == null || cell.equals(""))
    65. {
    66. return String.valueOf("");
    67. }
    68. else {
    69. switch (cell.getCellTypeEnum()) {
    70. case BOOLEAN:
    71. return String.valueOf(cell.getBooleanCellValue());
    72. case NUMERIC:
    73. double value = cell.getNumericCellValue();
    74. return new BigDecimal(value).toString();
    75. case STRING:
    76. return String.valueOf(cell.getStringCellValue());
    77. default:
    78. return String.valueOf(cell.getStringCellValue());
    79. }
    80. }
    81. }
    82. }

    pom.xml文件

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    4. <modelVersion>4.0.0</modelVersion>
    5. <groupId>com.jxxdxy</groupId>
    6. <artifactId>wlms</artifactId>
    7. <version>1.0-SNAPSHOT</version>
    8. <packaging>war</packaging>
    9. <name>wlms Maven Webapp</name>
    10. <!-- FIXME change it to the project's website -->
    11. <url>http://www.example.com</url>
    12. <properties>
    13. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    14. <maven.compiler.source>1.7</maven.compiler.source>
    15. <maven.compiler.target>1.7</maven.compiler.target>
    16. <spring-version>3.2.8.RELEASE</spring-version>
    17. <jdbc.version>8.0.12</jdbc.version>
    18. <log4j.version>2.7</log4j.version>
    19. <slf4j.version>1.7.21</slf4j.version>
    20. <httpasyncclient.version>4.1.2</httpasyncclient.version>
    21. <jdk.version>1.7</jdk.version>
    22. </properties>
    23. <profiles>
    24. <profile>
    25. <id>maven2-release</id>
    26. <distributionManagement>
    27. <snapshotRepository>
    28. <id>oss</id>
    29. <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    30. </snapshotRepository>
    31. <repository>
    32. <id>oss</id>
    33. <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    34. </repository>
    35. </distributionManagement>
    36. </profile>
    37. </profiles>
    38. <dependencies>
    39. <!-- 短信发送-->
    40. <dependency>
    41. <groupId>com.yunpian.sdk</groupId>
    42. <artifactId>yunpian-java-sdk</artifactId>
    43. <version>1.2.7</version>
    44. </dependency>
    45. <!--支付宝-->
    46. <dependency>
    47. <groupId>com.alipay.sdk</groupId>
    48. <artifactId>alipay-sdk-java</artifactId>
    49. <version>3.7.4.ALL</version>
    50. </dependency>
    51. <dependency>
    52. <groupId>org.slf4j</groupId>
    53. <artifactId>slf4j-api</artifactId>
    54. <version>${slf4j.version}</version>
    55. </dependency>
    56. <dependency>
    57. <groupId>org.slf4j</groupId>
    58. <artifactId>slf4j-simple</artifactId>
    59. <version>${slf4j.version}</version>
    60. <scope>test</scope>
    61. </dependency>
    62. <dependency>
    63. <groupId>org.slf4j</groupId>
    64. <artifactId>slf4j-nop</artifactId>
    65. <version>1.7.2</version>
    66. </dependency>
    67. <dependency>
    68. <groupId>com.google.code.gson</groupId>
    69. <artifactId>gson</artifactId>
    70. <version>2.8.0</version>
    71. </dependency>
    72. <dependency>
    73. <groupId>org.apache.httpcomponents</groupId>
    74. <artifactId>httpasyncclient</artifactId>
    75. <version>${httpasyncclient.version}</version>
    76. </dependency>
    77. <dependency>
    78. <groupId>org.apache.httpcomponents</groupId>
    79. <artifactId>httpasyncclient-cache</artifactId>
    80. <version>${httpasyncclient.version}</version>
    81. </dependency>
    82. <dependency>
    83. <groupId>org.apache.httpcomponents</groupId>
    84. <artifactId>httpmime</artifactId>
    85. <version>4.5.2</version>
    86. </dependency>
    87. <!-- 连接池-->
    88. <dependency>
    89. <groupId>com.alibaba</groupId>
    90. <artifactId>druid</artifactId>
    91. <version>1.0.9</version>
    92. </dependency>
    93. <dependency>
    94. <groupId>org.aspectj</groupId>
    95. <artifactId>aspectjweaver</artifactId>
    96. <version>1.8.8</version>
    97. </dependency>
    98. <dependency>
    99. <groupId>log4j</groupId>
    100. <artifactId>log4j</artifactId>
    101. <version>1.2.17</version>
    102. </dependency>
    103. <dependency>
    104. <groupId>org.codehaus.xfire</groupId>
    105. <artifactId>xfire-spring</artifactId>
    106. <version>1.2.6</version>
    107. <exclusions>
    108. <exclusion>
    109. <groupId>org.springframework</groupId>
    110. <artifactId>spring</artifactId>
    111. </exclusion>
    112. </exclusions>
    113. </dependency>
    114. <dependency>
    115. <groupId>org.apache.poi</groupId>
    116. <artifactId>poi-ooxml</artifactId>
    117. <version>3.17</version>
    118. </dependency>
    119. <dependency>
    120. <groupId>org.apache.poi</groupId>
    121. <artifactId>poi</artifactId>
    122. <version>3.17</version>
    123. </dependency>
    124. <dependency>
    125. <groupId>org.apache.poi</groupId>
    126. <artifactId>poi-ooxml-schemas</artifactId>
    127. <version>3.17</version>
    128. </dependency>
    129. <dependency>
    130. <groupId>junit</groupId>
    131. <artifactId>junit</artifactId>
    132. <version>4.11</version>
    133. <scope>test</scope>
    134. </dependency>
    135. <!--Spring配置-->
    136. <dependency>
    137. <groupId>commons-dbcp</groupId>
    138. <artifactId>commons-dbcp</artifactId>
    139. <version>1.4</version>
    140. </dependency>
    141. <dependency>
    142. <groupId>commons-pool</groupId>
    143. <artifactId>commons-pool</artifactId>
    144. <version>1.6</version>
    145. </dependency>
    146. <dependency>
    147. <groupId>org.springframework</groupId>
    148. <artifactId>spring-core</artifactId>
    149. <version>${spring-version}</version>
    150. </dependency>
    151. <dependency>
    152. <groupId>org.springframework</groupId>
    153. <artifactId>spring-test</artifactId>
    154. <version>${spring-version}</version>
    155. </dependency>
    156. <dependency>
    157. <groupId>org.springframework</groupId>
    158. <artifactId>spring-context</artifactId>
    159. <version>${spring-version}</version>
    160. </dependency>
    161. <dependency>
    162. <groupId>org.springframework</groupId>
    163. <artifactId>spring-tx</artifactId>
    164. <version>${spring-version}</version>
    165. </dependency>
    166. <dependency>
    167. <groupId>org.springframework</groupId>
    168. <artifactId>spring-context-support</artifactId>
    169. <version>${spring-version}</version>
    170. </dependency>
    171. <dependency>
    172. <groupId>org.springframework</groupId>
    173. <artifactId>spring-jdbc</artifactId>
    174. <version>${spring-version}</version>
    175. </dependency>
    176. <dependency>
    177. <groupId>org.springframework</groupId>
    178. <artifactId>spring-aop</artifactId>
    179. <version>${spring-version}</version>
    180. </dependency>
    181. <dependency>
    182. <groupId>org.springframework</groupId>
    183. <artifactId>spring-beans</artifactId>
    184. <version>${spring-version}</version>
    185. </dependency>
    186. <dependency>
    187. <groupId>org.springframework</groupId>
    188. <artifactId>spring-webmvc</artifactId>
    189. <version>${spring-version}</version>
    190. </dependency>
    191. <!--事务-->
    192. <dependency>
    193. <groupId>org.springframework</groupId>
    194. <artifactId>spring-aspects</artifactId>
    195. <version>${spring-version}</version>
    196. </dependency>
    197. <dependency>
    198. <groupId>org.springframework</groupId>
    199. <artifactId>spring-jms</artifactId>
    200. <version>${spring-version}</version>
    201. </dependency>
    202. <!-- mybatis核心包 -->
    203. <dependency>
    204. <groupId>org.mybatis</groupId>
    205. <artifactId>mybatis</artifactId>
    206. <version>3.3.0</version>
    207. </dependency>
    208. <!-- mybatis/spring包 -->
    209. <dependency>
    210. <groupId>org.mybatis</groupId>
    211. <artifactId>mybatis-spring</artifactId>
    212. <version>1.2.2</version>
    213. </dependency>
    214. <!-- 数据库驱动 -->
    215. <dependency>
    216. <groupId>mysql</groupId>
    217. <artifactId>mysql-connector-java</artifactId>
    218. <version>${jdbc.version}</version>
    219. </dependency>
    220. <!-- json包-->
    221. <dependency>
    222. <groupId>com.alibaba</groupId>
    223. <artifactId>fastjson</artifactId>
    224. <version>1.2.31</version>
    225. </dependency>
    226. <!-- log4j -->
    227. <dependency>
    228. <groupId>org.apache.logging.log4j</groupId>
    229. <artifactId>log4j-core</artifactId>
    230. <version>${log4j.version}</version>
    231. </dependency>
    232. <!--文件上传包 -->
    233. <dependency>
    234. <groupId>commons-fileupload</groupId>
    235. <artifactId>commons-fileupload</artifactId>
    236. <version>1.3.2</version>
    237. </dependency>
    238. <dependency>
    239. <groupId>commons-io</groupId>
    240. <artifactId>commons-io</artifactId>
    241. <version>2.5</version>
    242. </dependency>
    243. <dependency>
    244. <groupId>javax.servlet</groupId>
    245. <artifactId>servlet-api</artifactId>
    246. <version>2.5</version>
    247. </dependency>
    248. <dependency>
    249. <groupId>org.json</groupId>
    250. <artifactId>json</artifactId>
    251. <version>20160810</version>
    252. </dependency>
    253. </dependencies>
    254. <build>
    255. <!-- 短信发送-->
    256. <resources>
    257. <resource>
    258. <directory>src/main/java</directory>
    259. <includes>
    260. <include>**/*.properties</include>
    261. <include>**/*.xml</include>
    262. </includes>
    263. </resource>
    264. <resource>
    265. <directory>src/main/resources</directory>
    266. <includes>
    267. <include>**/*.properties</include>
    268. <include>**/*.xml</include>
    269. </includes>
    270. </resource>
    271. </resources>
    272. <plugins>
    273. <plugin>
    274. <groupId>org.apache.maven.plugins</groupId>
    275. <artifactId>maven-compiler-plugin</artifactId>
    276. <version>3.6.0</version>
    277. <configuration>
    278. <source>${jdk.version}</source>
    279. <target>${jdk.version}</target>
    280. <encoding>${project.build.sourceEncoding}</encoding>
    281. </configuration>
    282. </plugin>
    283. <plugin>
    284. <groupId>org.apache.maven.plugins</groupId>
    285. <artifactId>maven-resources-plugin</artifactId>
    286. <version>3.0.1</version>
    287. <executions>
    288. <execution>
    289. <phase>compile</phase>
    290. </execution>
    291. </executions>
    292. <configuration>
    293. <encoding>${project.build.sourceEncoding}</encoding>
    294. </configuration>
    295. </plugin>
    296. <plugin>
    297. <groupId>org.apache.maven.plugins</groupId>
    298. <artifactId>maven-surefire-plugin</artifactId>
    299. <version>2.19.1</version>
    300. <configuration>
    301. <skip>true</skip>
    302. </configuration>
    303. </plugin>
    304. <plugin>
    305. <artifactId>maven-assembly-plugin</artifactId>
    306. <executions>
    307. <execution>
    308. <phase>package</phase>
    309. <goals>
    310. <goal>single</goal>
    311. </goals>
    312. </execution>
    313. </executions>
    314. <configuration>
    315. <descriptorRefs>
    316. <descriptorRef>jar-with-dependencies</descriptorRef>
    317. </descriptorRefs>
    318. </configuration>
    319. </plugin>
    320. </plugins>
    321. <!-- end-->
    322. <finalName>wlms</finalName>
    323. <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
    324. <plugins>
    325. <plugin>
    326. <artifactId>maven-clean-plugin</artifactId>
    327. <version>3.0.0</version>
    328. </plugin>
    329. <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
    330. <plugin>
    331. <artifactId>maven-resources-plugin</artifactId>
    332. <version>3.0.2</version>
    333. </plugin>
    334. <plugin>
    335. <artifactId>maven-compiler-plugin</artifactId>
    336. <version>3.7.0</version>
    337. </plugin>
    338. <plugin>
    339. <artifactId>maven-surefire-plugin</artifactId>
    340. <version>2.20.1</version>
    341. </plugin>
    342. <plugin>
    343. <artifactId>maven-war-plugin</artifactId>
    344. <version>3.2.0</version>
    345. </plugin>
    346. <plugin>
    347. <artifactId>maven-install-plugin</artifactId>
    348. <version>2.5.2</version>
    349. </plugin>
    350. <plugin>
    351. <artifactId>maven-deploy-plugin</artifactId>
    352. <version>2.8.2</version>
    353. </plugin>
    354. </plugins>
    355. </pluginManagement>
    356. </build>
    357. </project>