|
|
@@ -1,4 +1,5 @@
|
|
|
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+<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>
|
|
|
|
|
|
@@ -10,183 +11,208 @@
|
|
|
<name>ServerManagement</name>
|
|
|
<url>http://maven.apache.org</url>
|
|
|
|
|
|
+ <!--指定父级依赖 -->
|
|
|
+ <parent>
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
+ <artifactId>spring-boot-starter-parent</artifactId>
|
|
|
+ <version>2.2.4.RELEASE</version>
|
|
|
+ <relativePath /> <!-- lookup parent from repository -->
|
|
|
+ </parent>
|
|
|
+
|
|
|
<properties>
|
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
|
- <log4j.version>2.11.1</log4j.version>
|
|
|
- <slf4j.version>1.7.25</slf4j.version>
|
|
|
- <spring.version>5.1.4.RELEASE</spring.version>
|
|
|
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
|
|
+ <java.version>1.8</java.version>
|
|
|
+ <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
|
|
|
</properties>
|
|
|
|
|
|
<dependencies>
|
|
|
- <!-- 日志框架 slf4j(slf4j的api接口包)-->
|
|
|
- <dependency>
|
|
|
- <groupId>org.slf4j</groupId>
|
|
|
- <artifactId>slf4j-api</artifactId>
|
|
|
- <version>${slf4j.version}</version>
|
|
|
- </dependency>
|
|
|
-
|
|
|
- <!-- 日志 log4j2(log4j2的核心包) -->
|
|
|
<dependency>
|
|
|
- <groupId>org.apache.logging.log4j</groupId>
|
|
|
- <artifactId>log4j-core</artifactId>
|
|
|
- <version>${log4j.version}</version>
|
|
|
+ <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>
|
|
|
-
|
|
|
- <!-- 日志 log4j2(slf4j对应log4j2日志框架的驱动包) -->
|
|
|
+
|
|
|
<dependency>
|
|
|
- <groupId>org.apache.logging.log4j</groupId>
|
|
|
- <artifactId>log4j-slf4j-impl</artifactId>
|
|
|
- <version>${log4j.version}</version>
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
+ <artifactId>spring-boot-starter-log4j2</artifactId>
|
|
|
</dependency>
|
|
|
|
|
|
<dependency>
|
|
|
- <groupId>org.springframework</groupId>
|
|
|
- <artifactId>spring-core</artifactId>
|
|
|
- <version>${spring.version}</version>
|
|
|
+ <groupId>org.springframework.cloud</groupId>
|
|
|
+ <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
|
|
|
</dependency>
|
|
|
+
|
|
|
+
|
|
|
<dependency>
|
|
|
- <groupId>org.springframework</groupId>
|
|
|
- <artifactId>spring-context</artifactId>
|
|
|
- <version>${spring.version}</version>
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
+ <artifactId>spring-boot-starter-test</artifactId>
|
|
|
+ <scope>test</scope>
|
|
|
</dependency>
|
|
|
-
|
|
|
+
|
|
|
<dependency>
|
|
|
<groupId>junit</groupId>
|
|
|
<artifactId>junit</artifactId>
|
|
|
- <version>3.8.1</version>
|
|
|
<scope>test</scope>
|
|
|
</dependency>
|
|
|
</dependencies>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ <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>
|
|
|
+
|
|
|
+
|
|
|
<build>
|
|
|
+ <!-- jar包名 -->
|
|
|
+ <finalName>ServerManagement</finalName>
|
|
|
+ <!--默认源代码目录 -->
|
|
|
+ <sourceDirectory>src/main/java </sourceDirectory>
|
|
|
+ <!--默认测试源代码目录 -->
|
|
|
+ <testSourceDirectory>src/test/java</testSourceDirectory>
|
|
|
+ <!--默认资源目录 -->
|
|
|
<resources>
|
|
|
- <resource>
|
|
|
- <directory>src/main/resources</directory>
|
|
|
- <filtering>true</filtering>
|
|
|
- <includes>
|
|
|
- <include>**/*.png</include>
|
|
|
- <include>**/*.properties</include>
|
|
|
- <include>**/*.xml</include>
|
|
|
- </includes>
|
|
|
- </resource>
|
|
|
- </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>
|
|
|
- </configuration>
|
|
|
- </plugin>
|
|
|
-
|
|
|
<plugin>
|
|
|
- <groupId>org.apache.maven.plugins</groupId>
|
|
|
- <artifactId>maven-jar-plugin</artifactId>
|
|
|
- <version>3.0.2</version>
|
|
|
- <configuration>
|
|
|
- <archive>
|
|
|
- <manifest>
|
|
|
- <addClasspath>true</addClasspath>
|
|
|
- <classpathPrefix>lib/</classpathPrefix>
|
|
|
- <mainClass>com.leanwo.management.App</mainClass>
|
|
|
- </manifest>
|
|
|
- </archive>
|
|
|
- </configuration>
|
|
|
- </plugin>
|
|
|
-
|
|
|
- <plugin>
|
|
|
- <groupId>org.apache.maven.plugins</groupId>
|
|
|
- <artifactId>maven-dependency-plugin</artifactId>
|
|
|
- <version>2.10</version>
|
|
|
- <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>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-compiler-plugin</artifactId>
|
|
|
+ <configuration>
|
|
|
+ <source>1.8</source>
|
|
|
+ <target>1.8</target>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
+ <artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
+ <!-- 忽略junit单元测试 -->
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-surefire-plugin</artifactId>
|
|
|
+ <version>2.20.1</version>
|
|
|
+ <configuration>
|
|
|
+ <skip>true</skip>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-jar-plugin</artifactId>
|
|
|
+ <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.management.ServerManagementApp</mainClass>
|
|
|
+ </manifest>
|
|
|
+ </archive>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
+ <!-- 复制资源文件 -->
|
|
|
+ <plugin>
|
|
|
<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}/ServerManagement/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>
|
|
|
</resource>
|
|
|
</resources>
|
|
|
</configuration>
|
|
|
- </execution>
|
|
|
+ </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}/ServerManagement/lib
|
|
|
- </outputDirectory>
|
|
|
+ <!-- 资源文件输出目录 -->
|
|
|
+ <outputDirectory>${project.build.directory}/${project.version}</outputDirectory>
|
|
|
<resources>
|
|
|
<resource>
|
|
|
- <directory>${project.build.directory}/lib/</directory>
|
|
|
+ <directory>src/main/resources</directory>
|
|
|
+ <includes>
|
|
|
+ <include>*.bat</include>
|
|
|
+ </includes>
|
|
|
</resource>
|
|
|
</resources>
|
|
|
</configuration>
|
|
|
</execution>
|
|
|
-
|
|
|
+
|
|
|
+ </executions>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
+ <!-- 分离lib -->
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-dependency-plugin</artifactId>
|
|
|
+ <executions>
|
|
|
<execution>
|
|
|
- <id>copy-resources-bat</id>
|
|
|
+ <id>copy-dependencies</id>
|
|
|
<phase>package</phase>
|
|
|
<goals>
|
|
|
- <goal>copy-resources</goal>
|
|
|
+ <goal>copy-dependencies</goal>
|
|
|
</goals>
|
|
|
<configuration>
|
|
|
- <encoding>UTF-8</encoding>
|
|
|
- <outputDirectory>${project.build.directory}/ServerManagement/
|
|
|
- </outputDirectory>
|
|
|
- <resources>
|
|
|
- <resource>
|
|
|
- <directory>config/</directory>
|
|
|
- <includes>
|
|
|
- <include>*.bat</include>
|
|
|
- </includes>
|
|
|
- </resource>
|
|
|
- <resource>
|
|
|
- <directory>${project.build.directory}</directory>
|
|
|
- <includes>
|
|
|
- <include>ServerManagement*.jar</include>
|
|
|
- </includes>
|
|
|
- </resource>
|
|
|
- </resources>
|
|
|
+ <!-- 依赖包输出目录 -->
|
|
|
+ <outputDirectory>${project.build.directory}/${project.version}/lib</outputDirectory>
|
|
|
+ <excludeTransitive>false</excludeTransitive>
|
|
|
+ <stripVersion>false</stripVersion>
|
|
|
+ <!-- 依赖包的作用域 -->
|
|
|
+ <includeScope>runtime</includeScope>
|
|
|
</configuration>
|
|
|
- </execution>
|
|
|
+ </execution>
|
|
|
</executions>
|
|
|
- </plugin>
|
|
|
+ </plugin>
|
|
|
</plugins>
|
|
|
</build>
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
</project>
|