pom.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <groupId>com.zcxk.smartcity</groupId>
  7. <artifactId>smart-city-dispatcher</artifactId>
  8. <version>1.0</version>
  9. <packaging>jar</packaging>
  10. <name>smart-city-dispatcher</name>
  11. <description>中城信科智慧城市数据分发平台</description>
  12. <parent>
  13. <groupId>org.springframework.boot</groupId>
  14. <artifactId>spring-boot-starter-parent</artifactId>
  15. <version>2.1.0.RELEASE</version>
  16. </parent>
  17. <properties>
  18. <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
  19. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  20. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  21. <java.version>1.8</java.version>
  22. </properties>
  23. <dependencies>
  24. <dependency>
  25. <groupId>org.springframework.boot</groupId>
  26. <artifactId>spring-boot-starter-data-rest</artifactId>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.springframework.boot</groupId>
  30. <artifactId>spring-boot-starter-test</artifactId>
  31. <scope>test</scope>
  32. </dependency>
  33. <dependency>
  34. <groupId>org.projectlombok</groupId>
  35. <artifactId>lombok</artifactId>
  36. </dependency>
  37. <!-- 构建Restful API -->
  38. <dependency>
  39. <groupId>io.springfox</groupId>
  40. <artifactId>springfox-swagger2</artifactId>
  41. <version>2.7.0</version>
  42. </dependency>
  43. <dependency>
  44. <groupId>io.springfox</groupId>
  45. <artifactId>springfox-swagger-ui</artifactId>
  46. <version>2.7.0</version>
  47. </dependency>
  48. <!--
  49. <dependency>
  50. <groupId>org.springframework.boot</groupId>
  51. <artifactId>spring-boot-starter-data-mongodb</artifactId>
  52. </dependency>
  53. -->
  54. <dependency>
  55. <groupId>org.springframework.kafka</groupId>
  56. <artifactId>spring-kafka</artifactId>
  57. </dependency>
  58. </dependencies>
  59. <build>
  60. <finalName>
  61. ${project.artifactId}-${project.version}_${maven.build.timestamp}
  62. </finalName>
  63. <plugins>
  64. <plugin>
  65. <groupId>org.springframework.boot</groupId>
  66. <artifactId>spring-boot-maven-plugin</artifactId>
  67. </plugin>
  68. <!-- 1、设置jar的入口类 -->
  69. <plugin>
  70. <groupId>org.apache.maven.plugins</groupId>
  71. <artifactId>maven-jar-plugin</artifactId>
  72. <configuration>
  73. <archive>
  74. <manifest>
  75. <addClasspath>true</addClasspath>
  76. <classpathPrefix>lib/</classpathPrefix>
  77. <mainClass>com.zcxk.smartcity.data.dispatcher.Application</mainClass>
  78. </manifest>
  79. </archive>
  80. </configuration>
  81. </plugin>
  82. <!--2、把附属的jar打到jar内部的lib目录中 -->
  83. <plugin>
  84. <groupId>org.apache.maven.plugins</groupId>
  85. <artifactId>maven-dependency-plugin</artifactId>
  86. <executions>
  87. <execution>
  88. <id>copy-dependencies</id>
  89. <phase>package</phase>
  90. <goals>
  91. <goal>copy-dependencies</goal>
  92. </goals>
  93. <configuration>
  94. <outputDirectory>${project.build.directory}/lib</outputDirectory>
  95. </configuration>
  96. </execution>
  97. </executions>
  98. </plugin>
  99. <!-- 3、打包过程忽略Junit测试 -->
  100. <plugin>
  101. <groupId>org.apache.maven.plugins</groupId>
  102. <artifactId>maven-surefire-plugin</artifactId>
  103. <configuration>
  104. <skip>true</skip>
  105. </configuration>
  106. </plugin>
  107. </plugins>
  108. </build>
  109. </project>