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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
3 changes: 3 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip
Comment on lines +1 to +3

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 | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

url="$(awk -F= '$1=="distributionUrl"{print $2}' .mvn/wrapper/maven-wrapper.properties)"
echo "distributionUrl=$url"

echo "Official SHA256 (from repository sidecar):"
curl -fsSL "${url}.sha256"

echo
echo "Configured checksum line (should exist):"
grep -n '^distributionSha256Sum=' .mvn/wrapper/maven-wrapper.properties || true

Repository: Juniorbarry26/kafka

Length of output: 292


🏁 Script executed:

# Try alternative methods to find official SHA256 for Maven 3.9.15
echo "=== Checking Maven Central directly ==="
# Try the base URL without .sha256
curl -fsSL -I "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip"

echo -e "\n=== Checking for .asc (GPG signature) file ==="
curl -fsSL -I "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip.asc"

echo -e "\n=== Checking for checksums.txt ==="
curl -fsSL -I "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/checksums.txt"

echo -e "\n=== Checking Apache Archives for checksum ==="
curl -fsSL -I "https://archive.apache.org/dist/maven/maven-3/3.9.15/binaries/apache-maven-3.9.15-bin.zip.sha512"

echo -e "\n=== Listing what's available in Maven Central for 3.9.15 ==="
curl -fsSL "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/" 2>/dev/null | grep -oP 'href="[^"]*"' | head -20 || true

Repository: Juniorbarry26/kafka

Length of output: 2682


🏁 Script executed:

echo "=== Fetching official SHA512 from Apache Archives ==="
curl -fsSL "https://archive.apache.org/dist/maven/maven-3/3.9.15/binaries/apache-maven-3.9.15-bin.zip.sha512"

echo -e "\n=== Fetching SHA512 from Maven Central ==="
curl -fsSL "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip.sha512"

echo -e "\n=== Checking Maven Wrapper documentation and source ==="
# Look for Maven wrapper configuration documentation
find . -name "*wrapper*" -o -name "*.md" | grep -i readme || true
ls -la .mvn/ 2>/dev/null || true

Repository: Juniorbarry26/kafka

Length of output: 651


🏁 Script executed:

echo "=== Checking Maven wrapper files ==="
ls -la .mvn/wrapper/

echo -e "\n=== Current maven-wrapper.properties content ==="
cat .mvn/wrapper/maven-wrapper.properties

echo -e "\n=== Searching for Maven wrapper documentation ==="
find . -type f \( -name "*.md" -o -name "*.txt" -o -name "*.xml" \) -exec grep -l "distributionSha256Sum\|distributionSha512Sum" {} \; 2>/dev/null || echo "No matches found"

echo -e "\n=== Checking pom.xml or maven-wrapper plugin config ==="
grep -A 20 -B 5 "maven-wrapper\|distributionSha" ./pom.xml 2>/dev/null || echo "Not found in pom.xml"

Repository: Juniorbarry26/kafka

Length of output: 629


🌐 Web query:

Maven wrapper properties distributionSha256Sum distributionSha512Sum supported

💡 Result:

The Maven Wrapper supports both SHA-256 and SHA-512 checksum verification for the Maven distribution and the Maven Wrapper JAR [1][2][3]. The following properties can be configured in the.mvn/wrapper/maven-wrapper.properties file: - distributionSha256Sum: The expected SHA-256 checksum of the Maven distribution [4][2]. - wrapperSha256Sum: The expected SHA-256 checksum of the maven-wrapper.jar [4][2]. - distributionSha512Sum: The expected SHA-512 checksum of the Maven distribution [1][3]. - wrapperSha512Sum: The expected SHA-512 checksum of the maven-wrapper.jar [1][3]. Support for SHA-512 checksums was introduced to align with the checksum formats published by the Apache Maven project, as Maven distributions are primarily published with SHA-512 checksums rather than SHA-256 [1][5]. While SHA-256 remains supported for backward compatibility, SHA-512 is the recommended approach for verifying modern Maven distributions [1]. When using these properties, the Maven Wrapper will validate the downloaded artifact against the provided checksum before execution [2][6]. If the checksum does not match, the wrapper will fail to prevent the execution of potentially compromised or corrupted files [1][6]. Note that checksum validation is not supported for the Maven Daemon (mvnd) [3].

Citations:


Add distributionSha512Sum to verify Maven distribution integrity.

Line 3 downloads an executable archive, but checksum verification is not configured. This leaves the wrapper without content-integrity pinning. Apache Maven officially publishes SHA-512 checksums (not SHA-256); configure verification using the official checksum:

 wrapperVersion=3.3.4
 distributionType=only-script
 distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip
+distributionSha512Sum=251c676eb88684d6dd86c666817979d256a335c31ad34ab0e1df17eeca1cd504a6c890e906a46d04e51cc7a4fb02f33a75971ef750558034e0a81c257be02267
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip
distributionSha512Sum=251c676eb88684d6dd86c666817979d256a335c31ad34ab0e1df17eeca1cd504a6c890e906a46d04e51cc7a4fb02f33a75971ef750558034e0a81c257be02267
🤖 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 @.mvn/wrapper/maven-wrapper.properties around lines 1 - 3, Add a
distributionSha512Sum property to the Maven wrapper properties to verify the
downloaded archive integrity: update the .mvn/wrapper/maven-wrapper.properties
by adding the distributionSha512Sum=<official SHA-512 checksum for
apache-maven-3.9.15-bin.zip> alongside the existing wrapperVersion,
distributionType, and distributionUrl entries so the wrapper will validate the
downloaded archive using the official SHA-512 checksum.

23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.8'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"

kafka:
image: confluentinc/cp-kafka:7.5.0
container_name: kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
295 changes: 295 additions & 0 deletions mvnw

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading