Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Maven CI

on:
push:
branches:
- '**'
pull_request:

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
cache: maven
Comment on lines +20 to +25

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the Java version configuration in pom.xml and confirm JDK 17 compatibility

echo "=== Java version property in pom.xml ==="
grep -A 2 "<java.version>" pom.xml

echo -e "\n=== Maven compiler plugin configuration ==="
grep -A 10 "maven-compiler-plugin" pom.xml | grep -E "(source|target|release)"

echo -e "\n=== Verification ==="
echo "CI uses JDK 17 but pom.xml specifies java.version=1.8"
echo "This will compile to Java 8 bytecode using JDK 17 toolchain"
echo "Confirm this is the intended configuration"

Repository: UltiKits/UltiLogin

Length of output: 602


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== CI workflow: .github/workflows/maven-ci.yml uses/actions ==="
sed -n '1,120p' .github/workflows/maven-ci.yml | rg -n "uses:"

echo -e "\n=== CI workflow: JDK step context (around line 20-25) ==="
nl -ba .github/workflows/maven-ci.yml | sed -n '15,35p'

echo -e "\n=== pom.xml: java.version + compiler plugin block ==="
nl -ba pom.xml | rg -n "<java\.version>|maven-compiler-plugin|<source>|\<target\>|<release>|<toolchain>|maven\.compiler\." -n | head -n 80 || true

echo -e "\n=== pom.xml: show compiler plugin section (best-effort) ==="
# Try to print a bounded region around maven-compiler-plugin if present
line=$(rg -n "maven-compiler-plugin" pom.xml | head -n1 | cut -d: -f1 || true)
if [[ -n "${line}" ]]; then
  start=$((line-20))
  end=$((line+80))
  nl -ba pom.xml | sed -n "${start},${end}p"
else
  echo "maven-compiler-plugin not found in pom.xml"
fi

Repository: UltiKits/UltiLogin

Length of output: 323


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== CI workflow: .github/workflows/maven-ci.yml uses/actions ==="
sed -n '1,120p' .github/workflows/maven-ci.yml | rg -n "uses:"

echo -e "\n=== CI workflow: show lines ~15-40 ==="
cat -n .github/workflows/maven-ci.yml | sed -n '15,45p'

echo -e "\n=== pom.xml: relevant Java/version/compiler settings (best-effort) ==="
cat -n pom.xml | rg -n "<java\.version>|maven-compiler-plugin|<source>|\<target\>|<release>|<toolchain>|maven\.compiler\."

Repository: UltiKits/UltiLogin

Length of output: 1002


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== pom.xml: java.version property ==="
rg -n "<java\.version>" pom.xml
echo
rg -n "maven-compiler-plugin" pom.xml
echo
echo "=== pom.xml: compiler source/target/release/toolchain sections (context) ==="
for pat in "<source>" "<target>" "<release>" "toolchain" "<maven.compiler" "maven.compiler"; do
  echo "--- pattern: $pat ---"
  rg -nF "$pat" pom.xml || true
done

echo
echo "=== pom.xml: show around first maven-compiler-plugin occurrence ==="
line=$(rg -n "maven-compiler-plugin" pom.xml | head -n1 | cut -d: -f1 || true)
if [[ -n "${line}" ]]; then
  start=$((line-25))
  end=$((line+120))
  sed -n "${start},${end}p" pom.xml | nl -ba | head -n 170
else
  echo "maven-compiler-plugin not found in pom.xml"
fi

Repository: UltiKits/UltiLogin

Length of output: 707


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Workflow actions in .github/workflows/maven-ci.yml ==="
sed -n '1,120p' .github/workflows/maven-ci.yml | rg -n "uses:"

echo
echo "=== pom.xml: show maven-compiler-plugin section with line numbers (bounded) ==="
line=$(rg -n "maven-compiler-plugin" pom.xml | head -n1 | cut -d: -f1)
start=$((line-20))
end=$((line+60))
if [[ "$start" -lt 1 ]]; then start=1; fi
sed -n "${start},${end}p" pom.xml | cat -n

Repository: UltiKits/UltiLogin

Length of output: 2871


Document the Java strategy (JDK 17 build targeting Java 8) and pin GitHub Actions

  • .github/workflows/maven-ci.yml uses JDK 17, while pom.xml sets <java.version>1.8</java.version> and maven-compiler-plugin compiles with <source>${java.version}</source> / <target>${java.version}</target>—this should be explicitly documented as “build with JDK 17, target Java 8 bytecode” (and ensure running tests on JDK 17 is intended).
  • Both actions/checkout@v4 and actions/setup-java@v4 are only pinned to major tags; pin them to full commit SHAs to satisfy the “unpinned action” policy/static analysis.
🧰 Tools
🪛 zizmor (1.25.2)

[error] 21-21: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/maven-ci.yml around lines 20 - 25, Update the CI workflow
to explicitly document that the build uses JDK 17 but targets Java 8 bytecode
(matching pom.xml's <java.version>1.8</java.version> and maven-compiler-plugin
source/target) by adding a short comment or job step description near the Setup
JDK step, and confirm tests are intended to run under JDK 17; additionally
replace the unpinned actions referenced (actions/checkout@v4 and
actions/setup-java@v4) with their corresponding full commit SHAs to satisfy the
unpinned-action policy so the workflow pins exact commits.


- name: Run tests
run: mvn -B test

- name: Build package
run: mvn -B package
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@Data
@EqualsAndHashCode(callSuper = true)
@Table("login_accounts")
public class AccountData extends BaseDataEntity<Integer> {
public class AccountData extends BaseDataEntity<String> {

@Column("player_uuid")
private String playerUuid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static AccountData createSampleAccount(UUID playerUuid, String playerName
account.setLastLogin(System.currentTimeMillis());
account.setLoginCount(5);
account.setFailedAttempts(0);
account.setId(playerUuid.hashCode());
account.setId(String.valueOf(playerUuid.hashCode()));
return account;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ void registerTime() {
@DisplayName("Should get and set id from parent class")
void id() {
AccountData account = new AccountData();
account.setId(123);
assertThat(account.getId()).isEqualTo(123);
account.setId("123");
assertThat(account.getId()).isEqualTo("123");
}

@Test
Expand Down
Loading