mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 04:59:21 +08:00
build: 新增 Maven deploy 配置
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -32,6 +32,9 @@ build/
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
# Maven ignore
|
||||
.flattened-pom.xml
|
||||
|
||||
### Temp ###
|
||||
*.log
|
||||
*.logs
|
||||
|
57
README.md
57
README.md
@@ -52,6 +52,63 @@ ContiNew Starter(Continue New Starter)是一种特殊类型的 Spring Boot S
|
||||
💬 如无加群意愿,欢迎在 <a href="https://github.com/Charles7c/continew-starter/discussions" target="_blank">Discussions</a> 中进行交流探讨~ 🍻
|
||||
</details>
|
||||
|
||||
## 快速使用
|
||||
|
||||
> **Note**
|
||||
> 目前 ContiNew Starter 尚处于开发中,若要提前体验 Snapshot(快照)版本,请按以下方法进行。如遇问题,诚邀反馈。
|
||||
|
||||
1.在项目 pom.xml 中配置 Snapshot(快照)仓库地址
|
||||
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>sonatype-nexus-snapshots</id>
|
||||
<name>Sonatype Nexus Snapshots</name>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
```
|
||||
|
||||
2.在项目 pom.xml 中锁定版本,替换 Spring Boot 父依赖/添加 ContiNew Starter 父依赖
|
||||
|
||||
```xml
|
||||
<parent>
|
||||
<groupId>top.charles7c.continew</groupId>
|
||||
<artifactId>continew-starter</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
```
|
||||
|
||||
3.在项目 pom.xml 中引入所需模块依赖
|
||||
|
||||
```xml
|
||||
<dependencies>
|
||||
<!-- 核心模块 -->
|
||||
<dependency>
|
||||
<groupId>top.charles7c.continew</groupId>
|
||||
<artifactId>continew-starter-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
4.在 application.yml 中根据引入模块,添加所需配置
|
||||
|
||||
e.g. 跨域配置
|
||||
|
||||
```yaml
|
||||
--- ### 跨域配置
|
||||
cors:
|
||||
enabled: true
|
||||
# 配置允许跨域的域名
|
||||
allowedOrigins: '*'
|
||||
# 配置允许跨域的请求方式
|
||||
allowedMethods: '*'
|
||||
# 配置允许跨域的请求头
|
||||
allowedHeaders: '*'
|
||||
# 配置允许跨域的响应头
|
||||
exposedHeaders: '*'
|
||||
```
|
||||
|
||||
## 贡献代码
|
||||
|
||||
### 分支说明
|
||||
|
@@ -3,6 +3,7 @@
|
||||
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</artifactId>
|
||||
|
@@ -4,6 +4,13 @@
|
||||
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>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.1.5</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<groupId>top.charles7c.continew</groupId>
|
||||
<artifactId>continew-starter-dependencies</artifactId>
|
||||
<version>${revision}</version>
|
||||
@@ -22,6 +29,15 @@
|
||||
<properties>
|
||||
<revision>1.0.0-SNAPSHOT</revision>
|
||||
<hutool.version>5.8.23</hutool.version>
|
||||
<!-- 基础配置 -->
|
||||
<java.version>17</java.version>
|
||||
<resource.delimiter>@</resource.delimiter>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<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-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
|
||||
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@@ -37,7 +53,7 @@
|
||||
<dependency>
|
||||
<groupId>top.charles7c.continew</groupId>
|
||||
<artifactId>continew-starter-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
@@ -65,4 +81,97 @@
|
||||
<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>
|
||||
<developerConnection>scm:git:git@github.com:Charles7c/continew-starter.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
<version>${flatten-maven-plugin.version}</version>
|
||||
<configuration>
|
||||
<updatePomFile>true</updatePomFile>
|
||||
<flattenMode>resolveCiFriendliesOnly</flattenMode>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>flatten.clean</id>
|
||||
<phase>clean</phase>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>sonatype-nexus-staging</id>
|
||||
<name>Nexus Release Repository</name>
|
||||
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>sonatype-nexus-snapshots</id>
|
||||
<name>Sonatype Nexus Snapshots</name>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
41
pom.xml
41
pom.xml
@@ -19,9 +19,14 @@
|
||||
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</artifactId>
|
||||
<artifactId>continew-starter-dependencies</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>continew-starter-dependencies/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>continew-starter</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
@@ -45,37 +50,9 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<revision>1.0.0-SNAPSHOT</revision>
|
||||
<spring-boot.version>3.1.5</spring-boot.version>
|
||||
|
||||
<spotless.version>2.30.0</spotless.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- Spring 依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- ContiNew Starter 依赖 -->
|
||||
<dependency>
|
||||
<groupId>top.charles7c.continew</groupId>
|
||||
<artifactId>continew-starter-dependencies</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 代码等格式化插件 -->
|
||||
@@ -126,4 +103,10 @@
|
||||
<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>
|
||||
<developerConnection>scm:git:git@github.com:Charles7c/continew-starter.git</developerConnection>
|
||||
</scm>
|
||||
</project>
|
Reference in New Issue
Block a user