当前位置:   article > 正文

maven聚合,继承等方式

maven聚合,继承等方式

需要install安装到本地仓库,或者私服,方可使用自己封装项目

编译,测试,打包,安装,发布

parent:

  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.zhurenjin.shop</groupId>
  7. <artifactId>springMavenShop</artifactId>
  8. <packaging>pom</packaging>
  9. <version>1.0-SNAPSHOT</version>
  10. <modules>
  11. <module>user-server</module>
  12. <module>order-server</module>
  13. <module>common-server</module>
  14. </modules>
  15. <!--这个是聚合函数的时使用,通常是版本控制-->
  16. <properties>
  17. <maven.compiler.source>17</maven.compiler.source>
  18. <maven.compiler.target>17</maven.compiler.target>
  19. <spring.verion>6.1.1</spring.verion>
  20. <jackson.verion>2.9.6</jackson.verion>
  21. <mysql.verion>8.0.33</mysql.verion>
  22. <shri.io.verion>1.5.3</shri.io.verion>
  23. <comonserver.verion>1.0.1</comonserver.verion>
  24. <io.verion>2.8.0</io.verion>
  25. </properties>
  26. <dependencyManagement>
  27. <dependencies>
  28. <dependency>
  29. <groupId>org.springframework</groupId>
  30. <artifactId>spring-context</artifactId>
  31. <version>${spring.verion}</version>
  32. </dependency>
  33. <dependency>
  34. <groupId>com.fasterxml.jackson.core</groupId>
  35. <artifactId>jackson-core</artifactId>
  36. <version>${jackson.verion}</version>
  37. </dependency>
  38. <dependency>
  39. <groupId>mysql</groupId>
  40. <artifactId>mysql-connector-java</artifactId>
  41. <version>${mysql.verion}</version>
  42. </dependency>
  43. <!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core -->
  44. <!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core -->
  45. <!-- <dependency>
  46. <groupId>org.apache.shiro</groupId>
  47. <artifactId>shiro-all</artifactId>
  48. <version>1.4.1</version>
  49. </dependency>-->
  50. <dependency>
  51. <groupId>commons-io</groupId>
  52. <artifactId>commons-io</artifactId>
  53. <version>${io.verion}</version>
  54. </dependency>
  55. <!--自己的install的包文件-->
  56. <dependency>
  57. <groupId>com.zhurenjin.shop</groupId>
  58. <version>${comonserver.verion}</version>
  59. <artifactId>common-server</artifactId>
  60. </dependency>
  61. </dependencies>
  62. </dependencyManagement>
  63. </project>

childs:

  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>springMavenShop</artifactId>
  7. <groupId>com.zhurenjin.shop</groupId>
  8. <version>1.0-SNAPSHOT</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>order-server</artifactId>
  12. <properties>
  13. <maven.compiler.source>17</maven.compiler.source>
  14. <maven.compiler.target>17</maven.compiler.target>
  15. </properties>
  16. <dependencies>
  17. <dependency>
  18. <groupId>org.springframework</groupId>
  19. <artifactId>spring-context</artifactId>
  20. </dependency>
  21. <dependency>
  22. <groupId>mysql</groupId>
  23. <artifactId>mysql-connector-java</artifactId>
  24. </dependency>
  25. <dependency>
  26. <groupId>com.zhurenjin.shop</groupId>
  27. <artifactId>common-server</artifactId>
  28. </dependency>
  29. </dependencies>
  30. </project>

自己封装的模块

  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>springMavenShop</artifactId>
  7. <groupId>com.zhurenjin.shop</groupId>
  8. <version>1.0-SNAPSHOT</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <version>1.0.1</version>
  12. <artifactId>common-server</artifactId>
  13. <properties>
  14. <maven.compiler.source>17</maven.compiler.source>
  15. <maven.compiler.target>17</maven.compiler.target>
  16. </properties>
  17. <dependencies>
  18. <dependency>
  19. <groupId>commons-io</groupId>
  20. <artifactId>commons-io</artifactId>
  21. </dependency>
  22. </dependencies>
  23. </project>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/522570
推荐阅读
相关标签
  

闽ICP备14008679号