Skip to content

Commit 9a2be48

Browse files
committed
Fix gradle build
1 parent 15d6f6c commit 9a2be48

11 files changed

Lines changed: 41 additions & 34 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,39 @@ jobs:
2121
contents: read
2222

2323
steps:
24-
- uses: actions/checkout@v4
25-
- name: Set up JDK 21
26-
uses: actions/setup-java@v4
24+
- uses: actions/checkout@v5
25+
- name: Set up JDK 23
26+
uses: actions/setup-java@v5
2727
with:
28-
java-version: '21'
28+
java-version: '23'
2929
distribution: 'temurin'
3030

3131
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
3232
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
3333
- name: Setup Gradle
3434
uses: gradle/actions/setup-gradle@v4
35+
with:
36+
cache-read-only: false
37+
38+
# Verify Java setup
39+
- name: Debug Java and Gradle setup
40+
run: |
41+
echo "=== Java Information ==="
42+
echo "JAVA_HOME: $JAVA_HOME"
43+
java -version
44+
which java
45+
echo ""
46+
echo "=== Gradle Java Toolchains ==="
47+
./gradlew -q javaToolchains
48+
echo ""
49+
echo "=== Gradle Properties ==="
50+
./gradlew -q properties | grep -E "(java|version|toolchain)"
51+
echo ""
52+
echo "=== Environment Variables ==="
53+
env | grep -E "(JAVA|GRADLE)"
3554
3655
- name: Build with Gradle Wrapper
37-
run: ./gradlew build
56+
run: ./gradlew clean build
3857

3958
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
4059
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Java CI with Maven
55

66
on:
77
push:
8-
branches: [ "master**", "dependabot/**" ]
8+
branches: [ "master**" ]
99
pull_request:
1010
types: [opened, synchronize, reopened]
1111

build.gradle

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ plugins {
55

66
group = 'me.chancesd.pvpmanager'
77

8+
java {
9+
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
10+
}
11+
812
subprojects {
913
apply plugin: 'java'
1014

1115
java {
12-
toolchain {
13-
languageVersion = JavaLanguageVersion.of(21)
14-
}
16+
sourceCompatibility = JavaVersion.VERSION_17
17+
targetCompatibility = JavaVersion.VERSION_17
1518
}
1619

1720
repositories {
@@ -35,14 +38,8 @@ subprojects {
3538
testImplementation 'org.mockito:mockito-core:5.18.0'
3639
}
3740

38-
test {
39-
useJUnitPlatform()
40-
}
41-
4241
tasks.withType(JavaCompile) {
4342
options.encoding = 'UTF-8'
44-
sourceCompatibility = '17'
45-
targetCompatibility = '17'
4643
}
4744
}
4845

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#This file is generated by updateDaemonJvm
2+
toolchainVersion=23

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

pvpmanager-folia/build.gradle

Lines changed: 0 additions & 9 deletions
This file was deleted.

pvpmanager/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = 'me.chancesd.pvpmanager'
9-
version = '3.18.30'
9+
version = '4.0.0'
1010
description = 'A powerful plugin to manage various PvP combat features'
1111

1212
dependencies {

pvpmanager/src/main/java/me/chancesd/pvpmanager/command/PM.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ public PM(final PluginCommand pluginCommand, final PvPManager plugin) {
5959
public void execute(final CommandSender sender, final String label, final List<CommandArgument> args) {
6060
if (args.isEmpty()) {
6161
helpCommand.helpMenu(sender, 1);
62-
return;
6362
} else if (args.size() == 1) {
6463
final int page = getArgument(args, "page").getAsInt();
6564
if (page > 0) {
6665
helpCommand.helpMenu(sender, page);
67-
return;
6866
}
6967
}
7068
}

pvpmanager/src/main/java/me/chancesd/pvpmanager/command/PvPList.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private String pvpListOffline() {
7878
if (!pvpState && name != null)
7979
list.append(name).append(", ");
8080
}
81-
if (list.toString().isEmpty())
81+
if (list.isEmpty())
8282
return Lang.PVP_LIST_NO_RESULTS.msg();
8383
list.delete(list.length() - 2, list.length());
8484
return list.toString();
@@ -92,7 +92,7 @@ private String pvpList(final CommandSender sender, final boolean enabled, final
9292
list.append(p.getName()).append(", ");
9393
}
9494
}
95-
if (list.toString().isEmpty())
95+
if (list.isEmpty())
9696
return Lang.PVP_LIST_NO_RESULTS.msg();
9797
list.delete(list.length() - 2, list.length());
9898
return list.toString();

pvpmanager/src/main/java/me/chancesd/pvpmanager/command/Worlds.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public void execute(final CommandSender sender, final String label, final List<C
4949
} else {
5050
sender.sendMessage("§cConsole must use '/pmr worlds list' to see world information.");
5151
}
52-
return;
5352
}
5453
}
5554

0 commit comments

Comments
 (0)