pom.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. <parent>
  6. <artifactId>sp-com</artifactId>
  7. <groupId>com.pj</groupId>
  8. <version>0.0.1-SNAPSHOT</version>
  9. <relativePath>../pom.xml</relativePath>
  10. </parent>
  11. <modelVersion>4.0.0</modelVersion>
  12. <artifactId>sp-start</artifactId>
  13. <packaging>jar</packaging>
  14. <!-- 指定一些属性 -->
  15. <properties>
  16. <!-- 主类地址,一定要配置,否则打包时运行会出错 -->
  17. <java.run.main.class>com.pj.SpStartApplication</java.run.main.class>
  18. </properties>
  19. <dependencies>
  20. <!-- ============== 项目依赖 start =============== -->
  21. <dependency>
  22. <groupId>com.pj</groupId>
  23. <artifactId>sp-core</artifactId>
  24. <version>${project.parent.version}</version>
  25. </dependency>
  26. <dependency>
  27. <groupId>com.pj</groupId>
  28. <artifactId>sp-admin</artifactId>
  29. <version>${project.parent.version}</version>
  30. </dependency>
  31. <dependency>
  32. <groupId>com.pj</groupId>
  33. <artifactId>sp-more</artifactId>
  34. <version>${project.parent.version}</version>
  35. </dependency>
  36. <!-- ============== 项目依赖 end =============== -->
  37. </dependencies>
  38. <!-- 构建配置 -->
  39. <build>
  40. <plugins>
  41. <!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
  42. <plugin>
  43. <groupId>org.apache.maven.plugins</groupId>
  44. <artifactId>maven-jar-plugin</artifactId>
  45. <configuration>
  46. <archive>
  47. <manifest>
  48. <addClasspath>true</addClasspath>
  49. <classpathPrefix>lib/</classpathPrefix>
  50. <mainClass>${java.run.main.class}</mainClass>
  51. </manifest>
  52. </archive>
  53. </configuration>
  54. </plugin>
  55. <!-- 拷贝依赖的jar包到lib目录 -->
  56. <plugin>
  57. <groupId>org.apache.maven.plugins</groupId>
  58. <artifactId>maven-dependency-plugin</artifactId>
  59. <executions>
  60. <execution>
  61. <id>copy</id>
  62. <phase>package</phase>
  63. <goals>
  64. <goal>copy-dependencies</goal>
  65. </goals>
  66. <configuration>
  67. <outputDirectory>
  68. ${project.build.directory}/lib
  69. </outputDirectory>
  70. </configuration>
  71. </execution>
  72. </executions>
  73. </plugin>
  74. </plugins>
  75. </build>
  76. </project>