123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.hcloud.microserver</groupId>
- <artifactId>common-parent</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <relativePath>../common-parent/pom.xml</relativePath>
- </parent>
- <groupId>com.hcloud.miroserver</groupId>
- <artifactId>goods-manage-service</artifactId>
- <version>${goods.managerclient.version}</version>
- <packaging>jar</packaging>
- <name>goods-manage-service</name>
- <description>Demo project for Spring Boot</description>
- <dependencies>
- <dependency>
- <groupId>com.hcloud.microserver</groupId>
- <artifactId>common-core</artifactId>
- <version>${common.core.version}</version>
- </dependency>
- <dependency>
- <groupId>com.hcloud.microserver</groupId>
- <artifactId>goods-manage-client</artifactId>
- <version>${goods.managerclient.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mybatis.spring.boot</groupId>
- <artifactId>mybatis-spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-eureka</artifactId>
- </dependency>
- <!--druid -->
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>druid</artifactId>
- </dependency>
- <!-- 分页支持pageHelper -->
- <dependency>
- <groupId>com.github.pagehelper</groupId>
- <artifactId>pagehelper-spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mybatis.spring.boot</groupId>
- <artifactId>mybatis-spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-cache</artifactId>
- <version>1.5.18.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-redis</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-ribbon</artifactId>
- </dependency>
- <!-- java9+版本以后,JAXB默认没有加载,手动添加jaxb模块 -->
- <!-- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.2.11</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-core</artifactId>
- <version>2.2.11</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.2.11</version>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>1.1.1</version>
- </dependency> -->
- <!-- SpringWeb模块 -->
- <!-- dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot</artifactId>
- <version>1.5.18.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency> -->
- </dependencies>
- <!-- <build>
- <plugins>
- 打JAR包
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- 不打包资源文件(配置文件和依赖包分开)
- <excludes>
- <exclude>*.**</exclude>
- <exclude>*/*.xml</exclude>
- </excludes>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- MANIFEST.MF 中 Class-Path 加入前缀
- <classpathPrefix>lib/</classpathPrefix>
- jar包不包含唯一版本标识
- <useUniqueVersions>false</useUniqueVersions>
- 指定入口类
- <mainClass>com.hcloud.microservice.goods.GoodsManageServiceApplication</mainClass>
- </manifest>
- <manifestEntries>
- MANIFEST.MF 中 Class-Path 加入资源文件目录
- <Class-Path>./resources/</Class-Path>
- </manifestEntries>
- </archive>
- <outputDirectory>${project.build.directory}</outputDirectory>
- </configuration>
- </plugin>
- 该插件的作用是用于复制依赖的jar包到指定的文件夹里
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/lib/</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- 该插件的作用是用于复制指定的文件
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution> 复制配置文件
- <id>copy-resources</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>*.properties</include>
- </includes>
- </resource>
- </resources>
- <outputDirectory>${project.build.directory}/resources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- SpringBoot 打包插件,把 maven-jar-plugin 打成的jar包重新打成可运行jar包
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <configuration>
- 重写包含依赖,包含不存在的依赖,jar里没有pom里的依赖
- <includes>
- <include>
- <groupId>null</groupId>
- <artifactId>null</artifactId>
- </include>
- </includes>
- <layout>ZIP</layout>
- 使用外部配置文件,jar包里没有资源文件
- <addResources>true</addResources>
- <outputDirectory>${project.build.directory}/resources</outputDirectory>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- <configuration>
- 配置jar包特殊标识 配置后,保留原文件,生成新文件 *-run.jar
- 配置jar包特殊标识 不配置,原文件命名为 *.jar.original,生成新文件 *.jar
- <classifier>run</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.18.1</version>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mybatis.generator</groupId>
- <artifactId>mybatis-generator-maven-plugin</artifactId>
- <version>1.3.5</version>
- <dependencies>
- <dependency>
- <groupId> mysql</groupId>
- <artifactId> mysql-connector-java</artifactId>
- <version>5.1.39</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis.generator</groupId>
- <artifactId>mybatis-generator-core</artifactId>
- <version>1.3.5</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>Generate MyBatis Artifacts</id>
- <phase>deploy</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- 允许移动生成的文件
- <verbose>true</verbose>
- 是否覆盖
- <overwrite>true</overwrite>
- 自动生成的配置
- <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
- </configuration>
- </plugin>
- </plugins>
- </build> -->
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.18.1</version>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mybatis.generator</groupId>
- <artifactId>mybatis-generator-maven-plugin</artifactId>
- <version>1.3.5</version>
- <dependencies>
- <dependency>
- <groupId> mysql</groupId>
- <artifactId> mysql-connector-java</artifactId>
- <version>5.1.39</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis.generator</groupId>
- <artifactId>mybatis-generator-core</artifactId>
- <version>1.3.5</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>Generate MyBatis Artifacts</id>
- <phase>deploy</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <!--允许移动生成的文件 -->
- <verbose>true</verbose>
- <!-- 是否覆盖 -->
- <overwrite>true</overwrite>
- <!-- 自动生成的配置 -->
- <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </project>
|