1. 统一maven依赖包以及插件版本管理

2. 支持打包tgz
This commit is contained in:
黄昕 2024-03-14 17:21:58 +08:00
parent 2f386bec52
commit 7e2b3d57d5
10 changed files with 361 additions and 48 deletions

78
cs-assembly/assembly.xml Normal file
View File

@ -0,0 +1,78 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd">
<id>${project.version}</id>
<formats>
<format>tgz</format>
</formats>
<fileSets>
<fileSet>
<directory>../cs-restful/target/</directory>
<includes>
<include>cs-restful-${project.version}.jar</include>
</includes>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
<fileSet>
<directory>../config</directory>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<fileSet>
<directory>../dist</directory>
<outputDirectory>${file.separator}dist</outputDirectory>
</fileSet>
<fileSet>
<directory>../bin</directory>
<outputDirectory>${file.separator}bin</outputDirectory>
</fileSet>
<fileSet>
<directory>../</directory>
<outputDirectory>${file.separator}</outputDirectory>
<includes>
<include>../CHANGELOG.md</include>
<include>../README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/resources/</directory>
<includes>
<include>
banner.txt
</include>
</includes>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<unpack>false</unpack>
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<scope>provided</scope>
</dependencySet>
<dependencySet>
<unpack>false</unpack>
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<scope>system</scope>
</dependencySet>
<dependencySet>
<unpack>false</unpack>
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>com.cf.cs:cs-base</include>
<include>com.cf.cs:cs-crypto</include>
<include>com.cf.cs:cs-protocol</include>
<include>com.cf.cs:cs-database</include>
<include>com.cf.cs:cs-authentication</include>
</includes>
</moduleSet>
</moduleSets>
</assembly>

88
cs-assembly/pom.xml Normal file
View File

@ -0,0 +1,88 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.cf.cs</groupId>
<artifactId>IntegrateService</artifactId>
<version>0.0.1-dev</version>
</parent>
<artifactId>cs-assembly</artifactId>
<name>cs-assembly</name>
<packaging>pom</packaging>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-base</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-crypto</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-database</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-protocol</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-authentication</artifactId>
<version>${cs-package.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<mainClass>com.cf.cs.restful.CsRestfulApplication</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>./</Class-Path>
</manifestEntries>
</archive>
<excludes>
<exclude>target/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -12,6 +12,10 @@
<name>cs-authentication</name>
<description>cs-authentication</description>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
@ -32,18 +36,15 @@
<dependency>
<groupId>org.casbin</groupId>
<artifactId>jcasbin</artifactId>
<version>1.50.0</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.12.3</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-protocol</artifactId>
<version>${cs-package.version}</version>
</dependency>
</dependencies>
@ -66,7 +67,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<goals>

View File

@ -13,6 +13,10 @@
<description>cs-base</description>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -35,20 +39,31 @@
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.8</version>
</dependency>
<dependency>
<groupId>com.houkunlin</groupId>
<artifactId>system-dict-starter</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations-jakarta</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>annotationProcessor</scope>
</dependency>
</dependencies>
<build>

View File

@ -13,6 +13,10 @@
<description>cs-crypto</description>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -41,7 +45,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<goals>

View File

@ -13,11 +13,14 @@
<description>cs-database</description>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>6.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -40,18 +43,15 @@
<dependency>
<groupId>com.mybatis-flex</groupId>
<artifactId>mybatis-flex-spring-boot3-starter</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>com.mybatis-flex</groupId>
<artifactId>mybatis-flex-processor</artifactId>
<version>1.8.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
@ -89,7 +89,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<goals>

View File

@ -29,7 +29,6 @@
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-restful</artifactId>
<version>${cs-package.version}</version>
</dependency>
</dependencies>
@ -50,7 +49,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<goals>

View File

@ -13,6 +13,10 @@
<description>cs-protocol</description>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -26,23 +30,19 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.1</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-base</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-crypto</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-database</artifactId>
<version>${cs-package.version}</version>
</dependency>
</dependencies>
@ -65,7 +65,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<goals>

View File

@ -13,6 +13,10 @@
<description>cs-restful-api</description>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -41,33 +45,27 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>1.5.0.Final</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.5.5.Final</version>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core-java11</artifactId>
<version>6.4.12</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-authentication</artifactId>
<version>${cs-package.version}</version>
</dependency>
</dependencies>
@ -77,13 +75,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>exec</classifier>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.9.10</version>
<executions>
<execution>
<id>get-the-git-infos</id>
@ -118,7 +115,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<goals>

175
pom.xml
View File

@ -19,7 +19,10 @@
<properties>
<cs-package.version>0.0.1-dev</cs-package.version>
<java.version>17</java.version>
<cs-package.java.version>17</cs-package.java.version>
<java.version>${cs-package.java.version}</java.version>
<!-- for sonarqube project setting-->
<sonar.projectKey>cmhi_integrateservice_c87e350f-7272-46e2-b9c3-68d9a9a30a9d</sonar.projectKey>
<sonar.projectName>IntegrateService</sonar.projectName>
<sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
@ -34,28 +37,151 @@
<module>cs-authentication</module>
<module>cs-restful</module>
<module>cs-integrate-test</module>
<module>cs-assembly</module>
</modules>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations-jakarta</artifactId>
<version>2.2.19</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.8</version>
</dependency>
<dependency>
<groupId>com.houkunlin</groupId>
<artifactId>system-dict-starter</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations-jakarta</artifactId>
<version>2.2.19</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
</dependency>
<dependency>
<groupId>org.casbin</groupId>
<artifactId>jcasbin</artifactId>
<version>1.50.0</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.12.3</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>6.2.2</version>
</dependency>
<dependency>
<groupId>com.mybatis-flex</groupId>
<artifactId>mybatis-flex-spring-boot3-starter</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>com.mybatis-flex</groupId>
<artifactId>mybatis-flex-processor</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.1</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>1.5.0.Final</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.5.5.Final</version>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core-java11</artifactId>
<version>6.4.12</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-base</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-crypto</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-database</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-protocol</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-authentication</artifactId>
<version>${cs-package.version}</version>
</dependency>
<dependency>
<groupId>com.cf.cs</groupId>
<artifactId>cs-restful</artifactId>
<version>${cs-package.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.9.10</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
@ -68,6 +194,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>CommonFramework</finalName>
<descriptors>
<descriptor>cs-assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>true</appendAssemblyId>
</configuration>
</plugin>
</plugins>
</build>
</project>