|
|
@@ -4,7 +4,7 @@
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
<groupId>com.leanwo.gateway</groupId>
|
|
|
<artifactId>GatewayServer</artifactId>
|
|
|
- <version>0.0.1-SNAPSHOT</version>
|
|
|
+ <version>0.0.1</version>
|
|
|
|
|
|
<!--指定父级依赖 -->
|
|
|
<parent>
|
|
|
@@ -25,18 +25,29 @@
|
|
|
<dependency>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-starter</artifactId>
|
|
|
+ <exclusions>
|
|
|
+ <exclusion>
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
+ <artifactId>spring-boot-starter-logging</artifactId>
|
|
|
+ </exclusion>
|
|
|
+ </exclusions>
|
|
|
</dependency>
|
|
|
-
|
|
|
+
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
+ <artifactId>spring-boot-starter-log4j2</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-netflix-zuul</artifactId>
|
|
|
- </dependency>
|
|
|
-
|
|
|
+
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.springframework.cloud</groupId>
|
|
|
+ <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
|
|
|
+ </dependency>
|
|
|
+
|
|
|
<dependency>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-starter-test</artifactId>
|
|
|
@@ -62,11 +73,11 @@
|
|
|
<build>
|
|
|
<!-- jar包名 -->
|
|
|
<finalName>GatewayServer</finalName>
|
|
|
- <!--默认源代码目录-->
|
|
|
- <sourceDirectory>src/main/java </sourceDirectory>
|
|
|
- <!--默认测试源代码目录-->
|
|
|
- <testSourceDirectory>src/test/java</testSourceDirectory>
|
|
|
- <!--默认资源目录-->
|
|
|
+ <!--默认源代码目录 -->
|
|
|
+ <sourceDirectory>src/main/java </sourceDirectory>
|
|
|
+ <!--默认测试源代码目录 -->
|
|
|
+ <testSourceDirectory>src/test/java</testSourceDirectory>
|
|
|
+ <!--默认资源目录 -->
|
|
|
<resources>
|
|
|
<resource>
|
|
|
<directory>src/main/resources</directory>
|
|
|
@@ -88,11 +99,10 @@
|
|
|
<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.20.1</version>
|
|
|
<configuration>
|
|
|
<skip>true</skip>
|
|
|
</configuration>
|
|
|
@@ -101,22 +111,35 @@
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
|
- <version>3.0.2</version>
|
|
|
<configuration>
|
|
|
+ <!-- 指定打包的jar包输出路径 -->
|
|
|
+ <outputDirectory>${project.build.directory}/${project.version}</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.file.server.FileServerApp</mainClass>
|
|
|
+ <mainClass>com.leanwo.gateway.GatewayApp</mainClass>
|
|
|
</manifest>
|
|
|
</archive>
|
|
|
</configuration>
|
|
|
</plugin>
|
|
|
|
|
|
+ <!-- 分离lib -->
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
<artifactId>maven-dependency-plugin</artifactId>
|
|
|
- <version>2.10</version>
|
|
|
<executions>
|
|
|
<execution>
|
|
|
<id>copy-dependencies</id>
|
|
|
@@ -125,30 +148,34 @@
|
|
|
<goal>copy-dependencies</goal>
|
|
|
</goals>
|
|
|
<configuration>
|
|
|
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
|
|
|
+ <!-- 依赖包输出目录 -->
|
|
|
+ <outputDirectory>${project.build.directory}/${project.version}/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>
|
|
|
- <version>3.0.2</version>
|
|
|
<executions>
|
|
|
<execution>
|
|
|
- <id>copy-resources-config</id>
|
|
|
+ <id>copy-dependencies</id>
|
|
|
<phase>package</phase>
|
|
|
<goals>
|
|
|
<goal>copy-resources</goal>
|
|
|
</goals>
|
|
|
<configuration>
|
|
|
- <encoding>UTF-8</encoding>
|
|
|
- <outputDirectory>${project.build.directory}/FileServer/config
|
|
|
- </outputDirectory>
|
|
|
+ <!-- 资源文件输出目录 -->
|
|
|
+ <outputDirectory>${project.build.directory}/${project.version}/resources</outputDirectory>
|
|
|
<resources>
|
|
|
<resource>
|
|
|
- <directory>config/</directory>
|
|
|
+ <directory>src/main/resources</directory>
|
|
|
<excludes>
|
|
|
<exclude>*.bat</exclude>
|
|
|
</excludes>
|
|
|
@@ -157,66 +184,22 @@
|
|
|
</configuration>
|
|
|
</execution>
|
|
|
|
|
|
-
|
|
|
<execution>
|
|
|
- <id>copy-resources-lib</id>
|
|
|
+ <id>copy-dependencies-bat</id>
|
|
|
<phase>package</phase>
|
|
|
<goals>
|
|
|
<goal>copy-resources</goal>
|
|
|
</goals>
|
|
|
<configuration>
|
|
|
- <encoding>UTF-8</encoding>
|
|
|
- <outputDirectory>${project.build.directory}/FileServer/lib
|
|
|
- </outputDirectory>
|
|
|
+ <!-- 资源文件输出目录 -->
|
|
|
+ <outputDirectory>${project.build.directory}/${project.version}</outputDirectory>
|
|
|
<resources>
|
|
|
<resource>
|
|
|
- <directory>${project.build.directory}/lib/</directory>
|
|
|
- </resource>
|
|
|
- </resources>
|
|
|
- </configuration>
|
|
|
- </execution>
|
|
|
-
|
|
|
- <execution>
|
|
|
- <id>copy-resources-bat</id>
|
|
|
- <phase>package</phase>
|
|
|
- <goals>
|
|
|
- <goal>copy-resources</goal>
|
|
|
- </goals>
|
|
|
- <configuration>
|
|
|
- <encoding>UTF-8</encoding>
|
|
|
- <outputDirectory>${project.build.directory}/FileServer/
|
|
|
- </outputDirectory>
|
|
|
- <resources>
|
|
|
- <resource>
|
|
|
- <directory>config/</directory>
|
|
|
+ <directory>src/main/resources</directory>
|
|
|
<includes>
|
|
|
<include>*.bat</include>
|
|
|
</includes>
|
|
|
</resource>
|
|
|
- <resource>
|
|
|
- <directory>${project.build.directory}</directory>
|
|
|
- <includes>
|
|
|
- <include>FileServer*.jar</include>
|
|
|
- </includes>
|
|
|
- </resource>
|
|
|
- </resources>
|
|
|
- </configuration>
|
|
|
- </execution>
|
|
|
-
|
|
|
- <execution>
|
|
|
- <id>copy-resources-content</id>
|
|
|
- <phase>package</phase>
|
|
|
- <goals>
|
|
|
- <goal>copy-resources</goal>
|
|
|
- </goals>
|
|
|
- <configuration>
|
|
|
- <encoding>UTF-8</encoding>
|
|
|
- <outputDirectory>${project.build.directory}/FileServer/content
|
|
|
- </outputDirectory>
|
|
|
- <resources>
|
|
|
- <resource>
|
|
|
- <directory>content</directory>
|
|
|
- </resource>
|
|
|
</resources>
|
|
|
</configuration>
|
|
|
</execution>
|