Skip to content

Commit e92309b

Browse files
author
Marvin Zhang
committed
chore: Update Maven profiles and GitHub Actions workflow
- Added separate profiles for 'release' and 'snapshot' versions in pom.xml, enhancing build configuration clarity. - Updated the 'release' profile to include versioning properties and improved plugin configurations for source and javadoc attachment. - Modified the GitHub Actions workflow to use JDK 17 instead of JDK 21, ensuring compatibility with the current project requirements.
1 parent daf890c commit e92309b

File tree

2 files changed

+48
-12
lines changed

2 files changed

+48
-12
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Maven Central Repository
1515
uses: actions/setup-java@v4
1616
with:
17-
java-version: '21'
17+
java-version: '17'
1818
distribution: 'temurin'
1919
server-id: central
2020
server-username: MAVEN_USERNAME

pom.xml

+47-11
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,11 @@
5050
</dependencies>
5151

5252
<profiles>
53+
<!-- Profile for Release Version -->
5354
<profile>
5455
<id>release</id>
5556
<build>
5657
<plugins>
57-
<plugin>
58-
<groupId>org.sonatype.central</groupId>
59-
<artifactId>central-publishing-maven-plugin</artifactId>
60-
<version>0.6.0</version>
61-
<extensions>true</extensions>
62-
<configuration>
63-
<publishingServerId>central</publishingServerId>
64-
<autoPublish>true</autoPublish>
65-
<waitUntil>published</waitUntil>
66-
</configuration>
67-
</plugin>
6858
<plugin>
6959
<groupId>org.apache.maven.plugins</groupId>
7060
<artifactId>maven-source-plugin</artifactId>
@@ -118,6 +108,52 @@
118108
</plugin>
119109
</plugins>
120110
</build>
111+
<properties>
112+
<version>0.7.0</version>
113+
</properties>
114+
</profile>
115+
116+
<!-- Profile for Snapshot Version -->
117+
<profile>
118+
<id>snapshot</id>
119+
<build>
120+
<plugins>
121+
<plugin>
122+
<groupId>org.apache.maven.plugins</groupId>
123+
<artifactId>maven-source-plugin</artifactId>
124+
<version>3.2.1</version>
125+
<executions>
126+
<execution>
127+
<id>attach-sources</id>
128+
<phase>verify</phase>
129+
<goals>
130+
<goal>jar-no-fork</goal>
131+
</goals>
132+
</execution>
133+
</executions>
134+
</plugin>
135+
<plugin>
136+
<groupId>org.apache.maven.plugins</groupId>
137+
<artifactId>maven-javadoc-plugin</artifactId>
138+
<version>3.3.1</version>
139+
<executions>
140+
<execution>
141+
<id>attach-javadoc</id>
142+
<goals>
143+
<goal>jar</goal>
144+
</goals>
145+
</execution>
146+
</executions>
147+
<configuration>
148+
<stylesheet>java</stylesheet>
149+
<doclint>none</doclint>
150+
</configuration>
151+
</plugin>
152+
</plugins>
153+
</build>
154+
<properties>
155+
<version>0.7.0-SNAPSHOT</version>
156+
</properties>
121157
</profile>
122158
</profiles>
123159
</project>

0 commit comments

Comments
 (0)