| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <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>
- <groupId>com.leanwo.gateway</groupId>
- <artifactId>GatewayServer</artifactId>
- <version>0.0.1</version>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <java.version>1.8</java.version>
- <spring-cloud.version>2020.0.4</spring-cloud.version>
- <java.jwt.version>3.7.0</java.jwt.version>
- </properties>
-
- <!--指定父级依赖 -->
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.4.6</version>
- <relativePath /> <!-- lookup parent from repository -->
- </parent>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-dependencies</artifactId>
- <version>${spring-cloud.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-bootstrap</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-gateway</artifactId>
- </dependency>
-
- <!-- spring cloud config 客户端包 -->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-config</artifactId>
- </dependency>
-
- <!-- Eureka服务发现注册 -->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
- </dependency>
- <!-- Feign 声明式服务 -->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-openfeign</artifactId>
- </dependency>
-
- <!--jwt 权限验证 -->
- <dependency>
- <groupId>com.auth0</groupId>
- <artifactId>java-jwt</artifactId>
- <version>${java.jwt.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
- <build>
- <!-- jar包名 -->
- <finalName>GatewayServer</finalName>
- <!--默认源代码目录 -->
- <sourceDirectory>src/main/java </sourceDirectory>
- <!--默认测试源代码目录 -->
- <testSourceDirectory>src/test/java</testSourceDirectory>
- <!--默认资源目录 -->
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <skip>true</skip>
- </configuration>
- </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>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>3.1.1</version>
- <configuration>
- <!-- 指定打包的jar包输出路径 -->
- <outputDirectory>${project.build.directory}/GatewayServer</outputDirectory>
- <!--不打入jar包的文件类型或者路径 -->
- <excludes>
- <!-- <exclude>**/*.properties</exclude> -->
- <!-- <exclude>**/*.xml</exclude> -->
- <!-- <exclude>**/*.yml</exclude> -->
- <!-- <exclude>static/**</exclude> -->
- <!-- <exclude>templates/**</exclude> -->
- </excludes>
- <archive>
- <!-- 指定配置文件目录,这样jar运行时会去找到同目录下的resources文件夹下查找 -->
- <manifestEntries>
- <Class-Path>resources/</Class-Path>
- </manifestEntries>
- <manifest>
- <addClasspath>true</addClasspath>
- <classpathPrefix>lib/</classpathPrefix>
- <mainClass>com.leanwo.gateway.GatewayApp</mainClass>
- </manifest>
- </archive>
- <!--注意这玩意从编译结果目录开始算目录结构-->
- <excludes>
- <exclude>**/*.yml</exclude>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.bat</exclude>
- <exclude>**/*.properties</exclude>
- <exclude>**/*.sql</exclude>
- <exclude>**/*.txt</exclude>
- <exclude>**/*.jks</exclude>
- </excludes>
- </configuration>
- </plugin>
- <!-- 分离lib -->
- <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}/GatewayServer/lib</outputDirectory>
- <excludeTransitive>false</excludeTransitive>
- <stripVersion>false</stripVersion>
- <!-- 依赖包的作用域 -->
- <includeScope>runtime</includeScope>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- 复制资源文件 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <!-- 资源文件输出目录 -->
- <outputDirectory>${project.build.directory}/GatewayServer/resources</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <excludes>
- <exclude>*.bat</exclude>
- </excludes>
- </resource>
- </resources>
- </configuration>
- </execution>
- <execution>
- <id>copy-dependencies-bat</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <!-- 资源文件输出目录 -->
- <outputDirectory>${project.build.directory}/GatewayServer</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>*.bat</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </project>
|