mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
剩余微服务infra、plan、report打包方式修改:
1、支持根据profile打包不同配置在jar外; 2、依赖lib打包在jar外; 3、增加test相关配置;
This commit is contained in:
@@ -169,6 +169,46 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<version>${maven.dependency.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<!-- 将依赖放到target/lib目录下 -->
|
||||||
|
<outputDirectory>target/lib</outputDirectory>
|
||||||
|
<!-- 排除自身的代码包-->
|
||||||
|
<excludeGroupIds>com.cf.imes</excludeGroupIds>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>${maven.assembly.plugin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<descriptors>
|
||||||
|
<!--指定assembly配置文件位置-->
|
||||||
|
<descriptor>src/main/build/assembly.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>bundle</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<assembly>
|
||||||
|
<id>bundle</id>
|
||||||
|
<formats>
|
||||||
|
<format>tar.gz</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
|
||||||
|
<fileSets>
|
||||||
|
<!-- 配置文件 -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/src/main/resources</directory>
|
||||||
|
<outputDirectory>config</outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>application-${profileActive}.yaml</include>
|
||||||
|
<include>bootstrap-${profileActive}.yaml</include>
|
||||||
|
<include>bootstrap.yaml</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<!-- 依赖库 -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/target/lib</directory>
|
||||||
|
<includes>
|
||||||
|
<include>*.jar</include>
|
||||||
|
</includes>
|
||||||
|
|
||||||
|
<outputDirectory>lib</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
<!-- 可执行的jar -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>${project.artifactId}.jar</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
|
||||||
|
</assembly>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
spring:
|
||||||
|
main:
|
||||||
|
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||||
|
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
--- #################### 注册中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.204:8848
|
||||||
|
discovery:
|
||||||
|
namespace: imes-test # 命名空间。这里使用 dev 开发环境
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
|
||||||
|
--- #################### 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||||
|
config:
|
||||||
|
server-addr: 192.168.1.204:8848 # Nacos 服务器地址
|
||||||
|
namespace: imes-test # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||||
|
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
||||||
@@ -146,6 +146,46 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<version>${maven.dependency.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<!-- 将依赖放到target/lib目录下 -->
|
||||||
|
<outputDirectory>target/lib</outputDirectory>
|
||||||
|
<!-- 排除自身的代码包-->
|
||||||
|
<excludeGroupIds>com.cf.imes</excludeGroupIds>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>${maven.assembly.plugin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<descriptors>
|
||||||
|
<!--指定assembly配置文件位置-->
|
||||||
|
<descriptor>src/main/build/assembly.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>bundle</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<assembly>
|
||||||
|
<id>bundle</id>
|
||||||
|
<formats>
|
||||||
|
<format>tar.gz</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
|
||||||
|
<fileSets>
|
||||||
|
<!-- 配置文件 -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/src/main/resources</directory>
|
||||||
|
<outputDirectory>config</outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>application-${profileActive}.yaml</include>
|
||||||
|
<include>bootstrap-${profileActive}.yaml</include>
|
||||||
|
<include>bootstrap.yaml</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<!-- 依赖库 -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/target/lib</directory>
|
||||||
|
<includes>
|
||||||
|
<include>*.jar</include>
|
||||||
|
</includes>
|
||||||
|
|
||||||
|
<outputDirectory>lib</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
<!-- 可执行的jar -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>${project.artifactId}.jar</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
|
||||||
|
</assembly>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
spring:
|
||||||
|
main:
|
||||||
|
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||||
|
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
--- #################### 注册中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.204:8848
|
||||||
|
discovery:
|
||||||
|
namespace: imes-test # 命名空间。这里使用 dev 开发环境
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
|
||||||
|
--- #################### 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||||
|
config:
|
||||||
|
server-addr: 192.168.1.204:8848 # Nacos 服务器地址
|
||||||
|
namespace: imes-test # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||||
|
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
||||||
@@ -133,6 +133,46 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<version>${maven.dependency.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<!-- 将依赖放到target/lib目录下 -->
|
||||||
|
<outputDirectory>target/lib</outputDirectory>
|
||||||
|
<!-- 排除自身的代码包-->
|
||||||
|
<excludeGroupIds>com.cf.imes</excludeGroupIds>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>${maven.assembly.plugin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<descriptors>
|
||||||
|
<!--指定assembly配置文件位置-->
|
||||||
|
<descriptor>src/main/build/assembly.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>bundle</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<assembly>
|
||||||
|
<id>bundle</id>
|
||||||
|
<formats>
|
||||||
|
<format>tar.gz</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
|
||||||
|
<fileSets>
|
||||||
|
<!-- 配置文件 -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/src/main/resources</directory>
|
||||||
|
<outputDirectory>config</outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>application-${profileActive}.yaml</include>
|
||||||
|
<include>bootstrap-${profileActive}.yaml</include>
|
||||||
|
<include>bootstrap.yaml</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<!-- 依赖库 -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/target/lib</directory>
|
||||||
|
<includes>
|
||||||
|
<include>*.jar</include>
|
||||||
|
</includes>
|
||||||
|
|
||||||
|
<outputDirectory>lib</outputDirectory>
|
||||||
|
</fileSet>
|
||||||
|
<!-- 可执行的jar -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>${project.artifactId}.jar</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
|
||||||
|
</assembly>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
spring:
|
||||||
|
main:
|
||||||
|
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||||
|
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
--- #################### 注册中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.204:8848
|
||||||
|
discovery:
|
||||||
|
namespace: imes-test # 命名空间。这里使用 dev 开发环境
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
|
||||||
|
--- #################### 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||||
|
config:
|
||||||
|
server-addr: 192.168.1.204:8848 # Nacos 服务器地址
|
||||||
|
namespace: imes-test # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||||
|
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
||||||
Reference in New Issue
Block a user