Skip to content

Commit 7c55478

Browse files
committed
chore: Build java 21 modules only when java 21 is available
1 parent f994d9e commit 7c55478

8 files changed

Lines changed: 38 additions & 19 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,16 @@ You can also create your own translation file and, if you want, you can share it
115115
## Requirements
116116

117117
##### Compiling requirements:
118-
>- JDK 17+
118+
>- JDK 17+ for `authme-core` and `authme-spigot-legacy`
119+
>- JDK 21+ for the full multi-module build (`authme-spigot-1.21`, `authme-paper-common`, `authme-paper`, `authme-folia`)
119120
>- Maven (3.8.8+)
120121
>- Git/GitHub (Optional)
121122
122123
##### How to compile the project:
123124
>- Clone the project with Git/GitHub
124-
>- Execute command "mvn clean package"
125+
>- Execute command `mvn clean package`
126+
>- With JDK 17, Maven builds only the Java 17-compatible modules
127+
>- With JDK 21+, Maven builds the full reactor
125128
126129
##### Running requirements:
127130
>- Java 17+

authme-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
<artifactId>maven-javadoc-plugin</artifactId>
257257
<configuration>
258258
<finalName>${project.finalNameBase}</finalName>
259-
<source>${java.source}</source>
259+
<source>${module.java.version}</source>
260260
</configuration>
261261
<executions>
262262
<execution>

authme-folia/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<description>AuthMe plugin for Folia 1.21</description>
1717

1818
<properties>
19+
<module.java.version>21</module.java.version>
1920
<plugin.api-version>1.21.11</plugin.api-version>
2021
<module.classifier>Folia</module.classifier>
2122
</properties>
@@ -116,7 +117,7 @@
116117
<artifactId>maven-javadoc-plugin</artifactId>
117118
<configuration>
118119
<finalName>${project.build.finalName}</finalName>
119-
<source>${java.source}</source>
120+
<source>${module.java.version}</source>
120121
<detectOfflineLinks>false</detectOfflineLinks>
121122
</configuration>
122123
<executions>

authme-paper-common/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
<name>AuthMe Paper Common</name>
1616
<description>Shared Paper-derived implementation code for AuthMe Paper and Folia</description>
1717

18+
<properties>
19+
<module.java.version>21</module.java.version>
20+
</properties>
21+
1822
<dependencies>
1923
<dependency>
2024
<groupId>fr.xephi</groupId>

authme-paper/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<description>AuthMe plugin for PaperMC 1.21</description>
1717

1818
<properties>
19+
<module.java.version>21</module.java.version>
1920
<plugin.api-version>1.21.11</plugin.api-version>
2021
<module.classifier>Paper</module.classifier>
2122
</properties>
@@ -116,7 +117,7 @@
116117
<artifactId>maven-javadoc-plugin</artifactId>
117118
<configuration>
118119
<finalName>${project.build.finalName}</finalName>
119-
<source>${java.source}</source>
120+
<source>${module.java.version}</source>
120121
<detectOfflineLinks>false</detectOfflineLinks>
121122
</configuration>
122123
<executions>

authme-spigot-1.21/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<description>AuthMe plugin for Spigot 1.20.x and 1.21.x</description>
1717

1818
<properties>
19+
<module.java.version>21</module.java.version>
1920
<spigot.api.version>1.21.11-R0.2-SNAPSHOT</spigot.api.version>
2021
<plugin.api-version>1.21.11</plugin.api-version>
2122
<module.classifier>Spigot-1.21</module.classifier>
@@ -152,7 +153,7 @@
152153
<artifactId>maven-javadoc-plugin</artifactId>
153154
<configuration>
154155
<finalName>${project.build.finalName}</finalName>
155-
<source>${java.source}</source>
156+
<source>${module.java.version}</source>
156157
</configuration>
157158
<executions>
158159
<execution>

authme-spigot-legacy/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<artifactId>maven-javadoc-plugin</artifactId>
125125
<configuration>
126126
<finalName>${project.build.finalName}</finalName>
127-
<source>${java.source}</source>
127+
<source>${module.java.version}</source>
128128
</configuration>
129129
<executions>
130130
<execution>

pom.xml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@
5757
<modules>
5858
<module>authme-core</module>
5959
<module>authme-spigot-legacy</module>
60-
<module>authme-spigot-1.21</module>
61-
<module>authme-paper-common</module>
62-
<module>authme-paper</module>
63-
<module>authme-folia</module>
6460
</modules>
6561

6662
<properties>
@@ -71,10 +67,7 @@
7167
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
7268
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
7369
<revision>6.0.0-SNAPSHOT</revision>
74-
<java.source>17</java.source>
75-
<java.target>17</java.target>
76-
<java.apiVersion>17</java.apiVersion>
77-
<java.compiler.minimumVersion>17</java.compiler.minimumVersion>
70+
<module.java.version>17</module.java.version>
7871
<maven.minimumVersion>3.8.8</maven.minimumVersion>
7972

8073
<!-- Versioning properties -->
@@ -132,6 +125,18 @@
132125
<project.buildNumber>${env.BUILD_NUMBER}</project.buildNumber>
133126
</properties>
134127
</profile>
128+
<profile>
129+
<id>java21-modules</id>
130+
<activation>
131+
<jdk>[21,)</jdk>
132+
</activation>
133+
<modules>
134+
<module>authme-spigot-1.21</module>
135+
<module>authme-paper-common</module>
136+
<module>authme-paper</module>
137+
<module>authme-folia</module>
138+
</modules>
139+
</profile>
135140
<!-- Skip long hash tests, reduce the test time of 20-30 seconds -->
136141
<profile>
137142
<id>skipLongHashTests</id>
@@ -183,7 +188,7 @@
183188
<version>${maven.minimumVersion}</version>
184189
</requireMavenVersion>
185190
<requireJavaVersion>
186-
<version>[${java.compiler.minimumVersion},)</version>
191+
<version>[${module.java.version},)</version>
187192
</requireJavaVersion>
188193
</rules>
189194
<fail>true</fail>
@@ -206,9 +211,9 @@
206211
<artifactId>maven-compiler-plugin</artifactId>
207212
<version>3.13.0</version>
208213
<configuration>
209-
<source>${java.source}</source>
210-
<target>${java.target}</target>
211-
<release>${java.apiVersion}</release>
214+
<source>${module.java.version}</source>
215+
<target>${module.java.version}</target>
216+
<release>${module.java.version}</release>
212217
</configuration>
213218
</plugin>
214219
<plugin>
@@ -305,6 +310,10 @@
305310
</pluginManagement>
306311

307312
<plugins>
313+
<plugin>
314+
<groupId>org.apache.maven.plugins</groupId>
315+
<artifactId>maven-enforcer-plugin</artifactId>
316+
</plugin>
308317
<plugin>
309318
<groupId>org.codehaus.mojo</groupId>
310319
<artifactId>flatten-maven-plugin</artifactId>

0 commit comments

Comments
 (0)