build: 优化 Maven 配置

This commit is contained in:
2023-11-20 19:45:41 +08:00
parent 2c4fc7e314
commit 51d7c05902
3 changed files with 185 additions and 134 deletions

107
pom.xml
View File

@@ -3,10 +3,14 @@
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>
<parent>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-starter-dependencies</artifactId>
<version>${revision}</version>
<relativePath>./continew-starter-dependencies</relativePath>
</parent>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-starter</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
@@ -46,7 +50,6 @@
<url>https://github.com/Bull-BCLS</url>
</developer>
</developers>
<scm>
<url>https://github.com/Charles7c/continew-starter</url>
<connection>scm:git:git@github.com:Charles7c/continew-starter.git</connection>
@@ -54,10 +57,6 @@
</scm>
<properties>
<revision>1.0.0-SNAPSHOT</revision>
<spring-boot.version>3.1.5</spring-boot.version>
<!-- Maven Environment Versions -->
<java.version>17</java.version>
<resource.delimiter>@</resource.delimiter>
@@ -65,13 +64,6 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Maven Plugin Versions -->
<spotless.version>2.30.0</spotless.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
</properties>
<modules>
@@ -79,26 +71,13 @@
<module>continew-starter-core</module>
</modules>
<dependencyManagement>
<dependencies>
<!-- ContiNew Starter Dependencies -->
<dependency>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-starter-dependencies</artifactId>
<version>${revision}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<!-- 代码等格式化插件 -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<version>2.40.0</version>
<executions>
<execution>
<phase>compile</phase>
@@ -116,14 +95,17 @@
</java>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten-maven-plugin.version}</version>
<version>1.5.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
<flattenMode>oss</flattenMode>
<pomElements>
<parent>expand</parent>
<properties>keep</properties>
</pomElements>
</configuration>
<executions>
<execution>
@@ -144,67 +126,4 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>