This commit is contained in:
yulichang 2024-10-30 21:13:53 +08:00
parent eb3cecf626
commit ce3548c7d2
2 changed files with 20 additions and 7 deletions

View File

@ -32,7 +32,7 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Apache Maven Central - name: Publish to Apache Maven Central
run: mvn deploy -Prelease -Psnapshot run: mvn com.github.yulichang:pom-maven-plugin:1.0:pom -Psnapshot && mvn deploy -Prelease -Psnapshot
env: env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

23
pom.xml
View File

@ -44,8 +44,7 @@
</modules> </modules>
<properties> <properties>
<version>1.5.2</version> <revision>1.5.2</revision>
<revision>${version}</revision>
<mybatis.plus.version>3.5.9</mybatis.plus.version> <mybatis.plus.version>3.5.9</mybatis.plus.version>
<jdkVersion>17</jdkVersion> <jdkVersion>17</jdkVersion>
@ -84,9 +83,23 @@
<profiles> <profiles>
<profile> <profile>
<id>snapshot</id> <id>snapshot</id>
<properties> <build>
<revision>${version}-SNAPSHOT</revision> <plugins>
</properties> <plugin>
<groupId>com.github.yulichang</groupId>
<artifactId>pom-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<args>
<arg>
<xpath>project/properties/revision</xpath>
<format>%s-SNAPSHOT</format>
</arg>
</args>
</configuration>
</plugin>
</plugins>
</build>
</profile> </profile>
<profile> <profile>
<id>release</id> <id>release</id>