pom.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project>
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.zhzn.energy</groupId>
  5. <artifactId>energy-online-data-service</artifactId>
  6. <version>1.0-SNAPSHOT</version>
  7. <!-- 添加Spring Boot父项目 -->
  8. <parent>
  9. <groupId>org.springframework.boot</groupId>
  10. <artifactId>spring-boot-starter-parent</artifactId>
  11. <version>2.7.18</version>
  12. <relativePath/> <!-- lookup parent from repository -->
  13. </parent>
  14. <dependencies>
  15. <!-- 新增Spring Boot基础依赖 -->
  16. <!-- 在spring-boot-starter-web中排除logging -->
  17. <dependency>
  18. <groupId>org.springframework.boot</groupId>
  19. <artifactId>spring-boot-starter-web</artifactId>
  20. <exclusions>
  21. <exclusion>
  22. <groupId>org.springframework.boot</groupId>
  23. <artifactId>spring-boot-starter-logging</artifactId>
  24. </exclusion>
  25. </exclusions>
  26. </dependency>
  27. <!-- 添加logback依赖 -->
  28. <dependency>
  29. <groupId>ch.qos.logback</groupId>
  30. <artifactId>logback-classic</artifactId>
  31. <version>1.2.12</version>
  32. </dependency>
  33. <!-- 保持原有依赖 -->
  34. <dependency>
  35. <groupId>org.projectlombok</groupId>
  36. <artifactId>lombok</artifactId>
  37. <scope>provided</scope>
  38. </dependency>
  39. <dependency>
  40. <groupId>org.apache.commons</groupId>
  41. <artifactId>commons-lang3</artifactId>
  42. <version>3.10</version>
  43. </dependency>
  44. <!-- 104协议 -->
  45. <dependency>
  46. <groupId>org.openmuc</groupId>
  47. <artifactId>j60870</artifactId>
  48. <version>1.4.0</version>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.yaml</groupId>
  52. <artifactId>snakeyaml</artifactId>
  53. <version>2.0</version>
  54. </dependency>
  55. <!-- 添加log4j日志相关jar包:共3个jar-->
  56. <!-- https://mvnrepository.com/artifact/log4j/log4j -->
  57. <dependency>
  58. <groupId>log4j</groupId>
  59. <artifactId>log4j</artifactId>
  60. <version>1.2.17</version>
  61. </dependency>
  62. <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
  63. <dependency>
  64. <groupId>org.slf4j</groupId>
  65. <artifactId>slf4j-api</artifactId>
  66. <version>1.7.25</version>
  67. </dependency>
  68. <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 -->
  69. <dependency>
  70. <groupId>org.slf4j</groupId>
  71. <artifactId>slf4j-log4j12</artifactId>
  72. <version>1.7.25</version>
  73. <scope>compile</scope>
  74. </dependency>
  75. <dependency>
  76. <groupId>org.projectlombok</groupId>
  77. <artifactId>lombok</artifactId>
  78. <version>1.18.30</version>
  79. </dependency>
  80. <dependency>
  81. <groupId>wei.yigulu</groupId>
  82. <artifactId>protocol-iec104</artifactId>
  83. <version>2.4.23</version>
  84. </dependency>
  85. <dependency>
  86. <groupId>com.alibaba.fastjson2</groupId>
  87. <artifactId>fastjson2</artifactId>
  88. <version>2.0.34</version>
  89. </dependency>
  90. </dependencies>
  91. <build>
  92. <finalName>${project.artifactId}</finalName>
  93. <resources>
  94. <resource>
  95. <directory>src/main/resources/</directory>
  96. <filtering>true</filtering>
  97. <includes>
  98. <include>**/*.properties</include>
  99. </includes>
  100. </resource>
  101. <resource>
  102. <directory>src/main/resources/</directory>
  103. <filtering>true</filtering>
  104. </resource>
  105. </resources>
  106. <plugins>
  107. <!-- Compiler 插件, 设定JDK版本 -->
  108. <plugin>
  109. <groupId>org.apache.maven.plugins</groupId>
  110. <artifactId>maven-compiler-plugin</artifactId>
  111. <version>3.8.1</version>
  112. <configuration>
  113. <source>${java.version}</source>
  114. <target>${java.version}</target>
  115. <encoding>${project.build.sourceEncoding}</encoding>
  116. <showWarnings>true</showWarnings>
  117. </configuration>
  118. </plugin>
  119. <plugin>
  120. <groupId>org.apache.maven.plugins</groupId>
  121. <artifactId>maven-resources-plugin</artifactId>
  122. <version>2.6</version>
  123. </plugin>
  124. <plugin>
  125. <groupId>org.apache.maven.plugins</groupId>
  126. <artifactId>maven-shade-plugin</artifactId>
  127. <version>3.5.0</version>
  128. <executions>
  129. <execution>
  130. <phase>package</phase>
  131. <goals>
  132. <goal>shade</goal>
  133. </goals>
  134. <configuration>
  135. <transformers>
  136. <transformer
  137. implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
  138. <!-- 如果有主类需要指定 -->
  139. <mainClass>com.energy.online.data.OnlineDataMain</mainClass>
  140. </transformer>
  141. </transformers>
  142. <createDependencyReducedPom>false</createDependencyReducedPom>
  143. <filters>
  144. <filter>
  145. <artifact>*:*</artifact>
  146. <excludes>
  147. <exclude>META-INF/*.SF</exclude>
  148. <exclude>META-INF/*.DSA</exclude>
  149. <exclude>META-INF/*.RSA</exclude>
  150. </excludes>
  151. </filter>
  152. </filters>
  153. </configuration>
  154. </execution>
  155. </executions>
  156. </plugin>
  157. </plugins>
  158. </build>
  159. </project>