pom.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <packaging>jar</packaging>
  6. <parent>
  7. <groupId>com.kakarote</groupId>
  8. <artifactId>wkcrm</artifactId>
  9. <version>0.0.1-SNAPSHOT</version>
  10. </parent>
  11. <artifactId>wk_work</artifactId>
  12. <version>0.0.1-SNAPSHOT</version>
  13. <name>work</name>
  14. <description>项目管理</description>
  15. <dependencies>
  16. <dependency>
  17. <groupId>com.kakarote</groupId>
  18. <artifactId>core</artifactId>
  19. <version>${core.version}</version>
  20. </dependency>
  21. </dependencies>
  22. <build>
  23. <resources>
  24. <resource>
  25. <!-- xml放在java目录下-->
  26. <directory>src/main/java/com/kakarote/${name}/</directory>
  27. <includes>
  28. <include>**/*.xml</include>
  29. </includes>
  30. </resource>
  31. <!--解决idea不识别resources的问题-->
  32. <resource>
  33. <directory>src/main/resources</directory>
  34. <filtering>true</filtering>
  35. </resource>
  36. </resources>
  37. <plugins>
  38. <!--打包jar-->
  39. <plugin>
  40. <groupId>org.apache.maven.plugins</groupId>
  41. <artifactId>maven-jar-plugin</artifactId>
  42. <configuration>
  43. <archive>
  44. <manifest>
  45. <addClasspath>true</addClasspath>
  46. <!--MANIFEST.MF 中 Class-Path 加入前缀-->
  47. <classpathPrefix>lib/</classpathPrefix>
  48. <!--jar包不包含唯一版本标识-->
  49. <useUniqueVersions>false</useUniqueVersions>
  50. <!--指定入口类-->
  51. <mainClass>com.kakarote.work.WorkApplication</mainClass>
  52. </manifest>
  53. <manifestEntries>
  54. <!--MANIFEST.MF 中 Class-Path 加入资源文件目录-->
  55. <Class-Path>./config/</Class-Path>
  56. </manifestEntries>
  57. </archive>
  58. <outputDirectory>${project.build.directory}</outputDirectory>
  59. </configuration>
  60. </plugin>
  61. <!--拷贝依赖 copy-dependencies-->
  62. <plugin>
  63. <groupId>org.apache.maven.plugins</groupId>
  64. <artifactId>maven-dependency-plugin</artifactId>
  65. <executions>
  66. <execution>
  67. <id>copy-dependencies</id>
  68. <phase>package</phase>
  69. <goals>
  70. <goal>copy-dependencies</goal>
  71. </goals>
  72. <configuration>
  73. <outputDirectory>
  74. ${project.build.directory}/lib/
  75. </outputDirectory>
  76. </configuration>
  77. </execution>
  78. </executions>
  79. </plugin>
  80. <!--拷贝资源文件 copy-resources-->
  81. <plugin>
  82. <artifactId>maven-resources-plugin</artifactId>
  83. <executions>
  84. <execution>
  85. <id>copy-resources</id>
  86. <phase>package</phase>
  87. <goals>
  88. <goal>copy-resources</goal>
  89. </goals>
  90. <configuration>
  91. <resources>
  92. <resource>
  93. <directory>src/main/resources/</directory>
  94. </resource>
  95. </resources>
  96. <outputDirectory>${project.build.directory}/config</outputDirectory>
  97. </configuration>
  98. </execution>
  99. </executions>
  100. </plugin>
  101. <plugin>
  102. <artifactId>maven-assembly-plugin</artifactId>
  103. <configuration>
  104. <finalName>${name}</finalName>
  105. <appendAssemblyId>false</appendAssemblyId>
  106. <descriptors>
  107. <descriptor>../assembly.xml</descriptor>
  108. </descriptors>
  109. </configuration>
  110. <executions>
  111. <execution>
  112. <id>make-assembly</id>
  113. <phase>package</phase>
  114. <goals>
  115. <goal>single</goal>
  116. </goals>
  117. </execution>
  118. </executions>
  119. </plugin>
  120. </plugins>
  121. </build>
  122. </project>