pom.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <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">
  2. <modelVersion>4.0.0</modelVersion>
  3. <groupId>com.litongjava</groupId>
  4. <artifactId>tio-http-server-benchmark</artifactId>
  5. <version>1.0</version>
  6. <name>${project.artifactId}</name>
  7. <properties>
  8. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  9. <java.version>1.8</java.version>
  10. <maven.compiler.source>${java.version}</maven.compiler.source>
  11. <maven.compiler.target>${java.version}</maven.compiler.target>
  12. <graalvm.version>23.1.1</graalvm.version>
  13. <main.class>com.litongjava.tio.http.server.MainApp</main.class>
  14. </properties>
  15. <dependencies>
  16. <dependency>
  17. <groupId>com.litongjava</groupId>
  18. <artifactId>tio-http-server</artifactId>
  19. <version>3.7.3.v20240919-RELEASE</version>
  20. </dependency>
  21. <dependency>
  22. <groupId>com.litongjava</groupId>
  23. <artifactId>java-db</artifactId>
  24. <version>1.2.6</version>
  25. </dependency>
  26. <dependency>
  27. <groupId>junit</groupId>
  28. <artifactId>junit</artifactId>
  29. <version>4.12</version>
  30. <scope>test</scope>
  31. </dependency>
  32. <!-- https://mvnrepository.com/artifact/com.jfinal/activerecord -->
  33. <!--
  34. <dependency>
  35. <groupId>com.jfinal</groupId>
  36. <artifactId>activerecord</artifactId>
  37. <version>5.1.6</version>
  38. </dependency>
  39. -->
  40. <dependency>
  41. <groupId>com.alibaba.fastjson2</groupId>
  42. <artifactId>fastjson2</artifactId>
  43. <version>2.0.52</version>
  44. </dependency>
  45. <dependency>
  46. <groupId>net.sf.ehcache</groupId>
  47. <artifactId>ehcache-core</artifactId>
  48. <version>2.6.11</version>
  49. </dependency>
  50. <dependency>
  51. <groupId>mysql</groupId>
  52. <artifactId>mysql-connector-java</artifactId>
  53. <version>5.1.46</version>
  54. </dependency>
  55. <dependency>
  56. <groupId>com.zaxxer</groupId>
  57. <artifactId>HikariCP</artifactId>
  58. <version>4.0.3</version>
  59. </dependency>
  60. </dependencies>
  61. <profiles>
  62. <!-- 开发环境 -->
  63. <profile>
  64. <id>development</id>
  65. <activation>
  66. <activeByDefault>true</activeByDefault>
  67. </activation>
  68. <dependencies>
  69. <dependency>
  70. <groupId>ch.qos.logback</groupId>
  71. <artifactId>logback-classic</artifactId>
  72. <version>1.2.13</version>
  73. </dependency>
  74. </dependencies>
  75. </profile>
  76. <!-- 生产环境 -->
  77. <profile>
  78. <id>production</id>
  79. <dependencies>
  80. <dependency>
  81. <groupId>ch.qos.logback</groupId>
  82. <artifactId>logback-classic</artifactId>
  83. <version>1.2.13</version>
  84. </dependency>
  85. </dependencies>
  86. <build>
  87. <plugins>
  88. <plugin>
  89. <groupId>org.springframework.boot</groupId>
  90. <artifactId>spring-boot-maven-plugin</artifactId>
  91. <version>2.7.4</version>
  92. <configuration>
  93. <mainClass>${main.class}</mainClass>
  94. <excludeGroupIds>org.projectlombok</excludeGroupIds>
  95. </configuration>
  96. <!-- 设置执行目标 -->
  97. <executions>
  98. <execution>
  99. <goals>
  100. <goal>repackage</goal>
  101. </goals>
  102. </execution>
  103. </executions>
  104. </plugin>
  105. </plugins>
  106. </build>
  107. </profile>
  108. <!-- assembly -->
  109. <profile>
  110. <id>assembly</id>
  111. <dependencies>
  112. <dependency>
  113. <groupId>ch.qos.logback</groupId>
  114. <artifactId>logback-classic</artifactId>
  115. <version>1.2.13</version>
  116. </dependency>
  117. </dependencies>
  118. <build>
  119. <plugins>
  120. <plugin>
  121. <groupId>org.apache.maven.plugins</groupId>
  122. <artifactId>maven-jar-plugin</artifactId>
  123. <version>3.2.0</version>
  124. </plugin>
  125. <plugin>
  126. <groupId>org.apache.maven.plugins</groupId>
  127. <artifactId>maven-assembly-plugin</artifactId>
  128. <version>3.1.1</version>
  129. <configuration>
  130. <archive>
  131. <manifest>
  132. <mainClass>${main.class}</mainClass>
  133. </manifest>
  134. </archive>
  135. <descriptorRefs>
  136. <descriptorRef>jar-with-dependencies</descriptorRef>
  137. </descriptorRefs>
  138. <appendAssemblyId>false</appendAssemblyId>
  139. </configuration>
  140. <executions>
  141. <execution>
  142. <id>make-assembly</id>
  143. <phase>package</phase>
  144. <goals>
  145. <goal>single</goal>
  146. </goals>
  147. </execution>
  148. </executions>
  149. </plugin>
  150. </plugins>
  151. </build>
  152. </profile>
  153. <profile>
  154. <id>native</id>
  155. <dependencies>
  156. <!-- GraalVM 环境使用 jdk log -->
  157. <dependency>
  158. <groupId>org.slf4j</groupId>
  159. <artifactId>slf4j-jdk14</artifactId>
  160. <version>1.7.31</version>
  161. </dependency>
  162. <!-- GraalVM -->
  163. <dependency>
  164. <groupId>org.graalvm.sdk</groupId>
  165. <artifactId>graal-sdk</artifactId>
  166. <version>${graalvm.version}</version>
  167. <scope>provided</scope>
  168. </dependency>
  169. </dependencies>
  170. <build>
  171. <finalName>${project.artifactId}</finalName>
  172. <plugins>
  173. <plugin>
  174. <groupId>org.graalvm.nativeimage</groupId>
  175. <artifactId>native-image-maven-plugin</artifactId>
  176. <version>21.2.0</version>
  177. <executions>
  178. <execution>
  179. <goals>
  180. <goal>native-image</goal>
  181. </goals>
  182. <phase>package</phase>
  183. </execution>
  184. </executions>
  185. <configuration>
  186. <skip>false</skip>
  187. <imageName>${project.artifactId}</imageName>
  188. <mainClass>${main.class}</mainClass>
  189. <buildArgs>
  190. -H:+RemoveSaturatedTypeFlows
  191. --allow-incomplete-classpath
  192. --no-fallback
  193. </buildArgs>
  194. </configuration>
  195. </plugin>
  196. </plugins>
  197. </build>
  198. </profile>
  199. </profiles>
  200. </project>