搭建

image.png
字符编码
image.png
注解激活
image.png
java编译版本
image.png
文件过滤
image.png

pom文件修改

删除多余文件夹,添加pom
image.png

  1. <!-- 子模块继承后,提供作用:锁定版本号+子模块不用写groupId和version-->
  2. <properties>
  3. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  4. <maven.compiler.source>1.8</maven.compiler.source>
  5. <maven.compiler.target>1.8</maven.compiler.target>
  6. <junit.version>4.12</junit.version>
  7. <log4j.version>1.2.17</log4j.version>
  8. <lombok.version>1.16.18</lombok.version>
  9. <mysql.version>5.1.47</mysql.version>
  10. <druid.version>1.1.16</druid.version>
  11. <mybatis.spring.boot.version>1.3.2</mybatis.spring.boot.version>
  12. </properties>
  13. <!-- 子模块继承之后,提供作用:锁定版本+子模块不用写groupId和version -->
  14. <dependencyManagement>
  15. <dependencies>
  16. <!-- springboot 2.2.2 -->
  17. <dependency>
  18. <groupId>org.springframework.boot</groupId>
  19. <artifactId>spring-boot-dependencies</artifactId>
  20. <version>2.2.2.RELEASE</version>
  21. <type>pom</type>
  22. <scope>import</scope>
  23. </dependency>
  24. <!-- springcloud cloud Hoxton.SR1 -->
  25. <dependency>
  26. <groupId>org.springframework.cloud</groupId>
  27. <artifactId>spring-cloud-dependencies</artifactId>
  28. <version>Hoxton.SR1</version>
  29. <type>pom</type>
  30. <scope>import</scope>
  31. </dependency>
  32. <!-- springcloud cloud alibaba 2.1.0.RELEASE -->
  33. <dependency>
  34. <groupId>com.alibaba.cloud</groupId>
  35. <artifactId>spring-cloud-alibaba-dependencies</artifactId>
  36. <version>2.1.0.RELEASE</version>
  37. <type>pom</type>
  38. <scope>import</scope>
  39. </dependency>
  40. <dependency>
  41. <groupId>mysql</groupId>
  42. <artifactId>mysql-connector-java</artifactId>
  43. <version>${mysql.version}</version>
  44. </dependency>
  45. <dependency>
  46. <groupId>com.alibaba</groupId>
  47. <artifactId>druid</artifactId>
  48. <version>${druid.version}</version>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.mybatis.spring.boot</groupId>
  52. <artifactId>mybatis-spring-boot-starter</artifactId>
  53. <version>${mybatis.spring.boot.version}</version>
  54. </dependency>
  55. <dependency>
  56. <groupId>log4j</groupId>
  57. <artifactId>log4j</artifactId>
  58. <version>${log4j.version}</version>
  59. </dependency>
  60. <dependency>
  61. <groupId>junit</groupId>
  62. <artifactId>junit</artifactId>
  63. <version>${junit.version}</version>
  64. </dependency>
  65. <dependency>
  66. <groupId>com.alibaba</groupId>
  67. <artifactId>druid-spring-boot-starter</artifactId>
  68. <version>${druid.version}</version>
  69. </dependency>
  70. <dependency>
  71. <groupId>org.projectlombok</groupId>
  72. <artifactId>lombok</artifactId>
  73. <version>${lombok.version}</version>
  74. <optional>true</optional>
  75. </dependency>
  76. </dependencies>
  77. </dependencyManagement>
  78. <build>
  79. <plugins>
  80. <plugin>
  81. <groupId>org.springframework.boot</groupId>
  82. <artifactId>spring-boot-maven-plugin</artifactId>
  83. <configuration>
  84. <fork>true</fork>
  85. <addResources>true</addResources>
  86. </configuration>
  87. </plugin>
  88. </plugins>
  89. </build>