pom.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.zcxk.smartcity</groupId>
  5. <artifactId>smart-city-bat</artifactId>
  6. <packaging>jar</packaging>
  7. <version>1.0</version>
  8. <name>smart-city-bat</name>
  9. <url>http://maven.apache.org</url>
  10. <properties>
  11. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  12. <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
  13. </properties>
  14. <!-- spring-boot-starter-parent包含了大量配置好的依赖管理,在自己项目添加这些依赖的时候不需要写<version>版本号 -->
  15. <parent>
  16. <groupId>org.springframework.boot</groupId>
  17. <artifactId>spring-boot-starter-parent</artifactId>
  18. <version>2.0.1.RELEASE</version>
  19. <relativePath/>
  20. </parent>
  21. <dependencies>
  22. <!-- 实现web功能 -->
  23. <dependency>
  24. <groupId>org.springframework.boot</groupId>
  25. <artifactId>spring-boot-starter-web</artifactId>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.springframework.boot</groupId>
  29. <artifactId>spring-boot-starter-test</artifactId>
  30. <scope>test</scope>
  31. </dependency>
  32. <!-- 模版 -->
  33. <dependency>
  34. <groupId>org.springframework.boot</groupId>
  35. <artifactId>spring-boot-starter-thymeleaf</artifactId>
  36. </dependency>
  37. <dependency>
  38. <groupId>net.sourceforge.nekohtml</groupId>
  39. <artifactId>nekohtml</artifactId>
  40. </dependency>
  41. <dependency>
  42. <groupId>org.springframework.boot</groupId>
  43. <artifactId>spring-boot-starter-data-jpa</artifactId>
  44. </dependency>
  45. <dependency>
  46. <groupId>mysql</groupId>
  47. <artifactId>mysql-connector-java</artifactId>
  48. </dependency>
  49. <!--quartz依赖-->
  50. <dependency>
  51. <groupId>org.springframework.boot</groupId>
  52. <artifactId>spring-boot-starter-quartz</artifactId>
  53. </dependency>
  54. <!-- 构建Restful API -->
  55. <dependency>
  56. <groupId>io.springfox</groupId>
  57. <artifactId>springfox-swagger2</artifactId>
  58. <version>2.7.0</version>
  59. </dependency>
  60. <dependency>
  61. <groupId>io.springfox</groupId>
  62. <artifactId>springfox-swagger-ui</artifactId>
  63. <version>2.7.0</version>
  64. </dependency>
  65. <dependency>
  66. <groupId>com.alibaba</groupId>
  67. <artifactId>fastjson</artifactId>
  68. <version>1.2.41</version>
  69. </dependency>
  70. </dependencies>
  71. <build>
  72. <finalName>
  73. ${project.artifactId}-${project.version}_${maven.build.timestamp}
  74. </finalName>
  75. <plugins>
  76. <plugin>
  77. <groupId>org.springframework.boot</groupId>
  78. <artifactId>spring-boot-maven-plugin</artifactId>
  79. </plugin>
  80. <!-- 1、设置jar的入口类 -->
  81. <plugin>
  82. <groupId>org.apache.maven.plugins</groupId>
  83. <artifactId>maven-jar-plugin</artifactId>
  84. <configuration>
  85. <archive>
  86. <manifest>
  87. <addClasspath>true</addClasspath>
  88. <classpathPrefix>lib/</classpathPrefix>
  89. <mainClass>com.zcxk.smartcity.bat.Application</mainClass>
  90. </manifest>
  91. </archive>
  92. </configuration>
  93. </plugin>
  94. <!--2、把附属的jar打到jar内部的lib目录中 -->
  95. <plugin>
  96. <groupId>org.apache.maven.plugins</groupId>
  97. <artifactId>maven-dependency-plugin</artifactId>
  98. <executions>
  99. <execution>
  100. <id>copy-dependencies</id>
  101. <phase>package</phase>
  102. <goals>
  103. <goal>copy-dependencies</goal>
  104. </goals>
  105. <configuration>
  106. <outputDirectory>${project.build.directory}/lib</outputDirectory>
  107. </configuration>
  108. </execution>
  109. </executions>
  110. </plugin>
  111. <!-- 3、打包过程忽略Junit测试 -->
  112. <plugin>
  113. <groupId>org.apache.maven.plugins</groupId>
  114. <artifactId>maven-surefire-plugin</artifactId>
  115. <configuration>
  116. <skip>true</skip>
  117. </configuration>
  118. </plugin>
  119. </plugins>
  120. </build>
  121. </project>