Skip to content

Update to fix yaml error in pom and README.md content - #65

Merged
bamsemats merged 7 commits into
mainfrom
feature/pom-and-readme-fix
Feb 14, 2026
Merged

Update to fix yaml error in pom and README.md content#65
bamsemats merged 7 commits into
mainfrom
feature/pom-and-readme-fix

Conversation

@bamsemats

@bamsemats bamsemats commented Feb 13, 2026

Copy link
Copy Markdown

Add Maven Shade Plugin for building a fat JAR; update README with detailed project overview and usage instructions

Summary by CodeRabbit

  • Chores

    • Updated project version to 1.0-SNAPSHOT.
    • Build now produces a runnable fat JAR for simpler packaging and deployment (uses shading).
  • Documentation

    • Greatly expanded project documentation with architecture overview, component descriptions, deployment/dev instructions, examples, and configuration guidance.
    • README updated to reflect fat JAR runtime and default port 8080.

…ailed project overview and usage instructions
@coderabbitai

coderabbitai Bot commented Feb 13, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@fmazmz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 34 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Bumps project version to 1.0-SNAPSHOT, removes maven-jar-plugin and adds maven-shade-plugin (producing a fat JAR with mainClass org.juv25d.App), replaces a placeholder static README with extensive documentation, updates top-level README instructions, and applies a minor formatting change to StaticFilesPlugin.

Changes

Cohort / File(s) Summary
Build configuration
pom.xml
Version changed 1.0.0-beta1.0-SNAPSHOT; removed maven-jar-plugin; added org.apache.maven.plugins:maven-shade-plugin v3.5.1 configured to produce a shaded/fat JAR (finalName app, ManifestResourceTransformer mainClass org.juv25d.App).
Project documentation (static)
src/main/resources/static/README.md
Replaced placeholder with extensive project documentation covering architecture, components, running/development instructions, examples, configuration, and ADR guidance.
Top-level README
README.md
Updated examples and run instructions to reference port 8080 and launching via the fat JAR produced by Maven Shade Plugin.
Minor formatting
src/main/java/org/juv25d/plugin/StaticFilesPlugin.java
Non-functional formatting change (added trailing newline).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • kristina0x7

Poem

🐰 I stitched a jar that carries every class,
Docs grew tall where placeholders once passed,
Version hops on, a snapshot in the grass,
I nibble the changelog, quick and fast. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'yaml error' and updates to pom and README, but the actual changes focus on adding Maven Shade Plugin for fat JAR packaging and comprehensive README updates—not fixing a YAML error. Revise the title to accurately reflect the main changes, such as: 'Add Maven Shade Plugin for fat JAR packaging and expand README documentation' or 'Add Maven Shade Plugin and update project documentation.'
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/pom-and-readme-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bamsemats bamsemats self-assigned this Feb 13, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/main/resources/static/README.md`:
- Line 30: The README's Java version statement ("Java 21+") is inconsistent with
the project's compiler target; update either the README or the Maven build
configuration so they match: change the README line to reflect the actual
maven.compiler.release value (currently 25) or adjust the
<maven.compiler.release> in pom.xml to 21 (or your desired minimum) so README
and the Maven property maven.compiler.release are aligned; ensure the README
text and the pom.xml property remain consistent going forward.
- Line 166: The README note saying "Running the packaged JAR directly with `java
-jar` is not supported..." is now incorrect because this PR adds the
maven-shade-plugin to produce a fat JAR; update README.md to either remove that
sentence or replace it with a short note stating that a shaded (fat) JAR is
produced and can be run with `java -jar target/<artifact>-<version>-shaded.jar`,
and optionally mention the maven-shade-plugin or "shaded JAR" so readers know
dependencies are bundled.
🧹 Nitpick comments (1)
src/main/resources/static/README.md (1)

39-55: Add language identifiers to fenced code blocks.

Several fenced code blocks (e.g., lines 39, 141, 156, 162, 174, 269, 322, 364, 370, 386) lack a language specifier. Adding identifiers like text, yaml, or bash improves rendering and satisfies markdownlint MD040.

Also applies to: 141-143, 156-158, 162-164, 174-176, 269-271, 322-324, 364-366, 370-372, 386-388

Comment thread src/main/resources/static/README.md
Comment thread src/main/resources/static/README.md Outdated

@fmazmz fmazmz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi, did we plan to make a new release patch already?
Our deployment is scheduled on thursdays so not sure if I have missed something? : )
I dont think we should create a patch just for a readme update, that can be saved until next thursday when we have more sufficient progress.

However I can give you my review:
1: We did not need to update the POM version according to Martin, I think I forgot to revert it back to 1.0-SNAPSHOT as it was from the beginning, so maybe we can do that here.

2: This release does not run, and the docker image throws an exception:

~  docker run -p 8080:8080 ghcr.io/ithsjava25/project-webserver-juv25d:v1.0.1-beta            
Exception in thread "main" java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml
	at org.juv25d.util.ConfigLoader.loadConfiguration(ConfigLoader.java:26)
	at org.juv25d.util.ConfigLoader.<init>(ConfigLoader.java:15)
	at org.juv25d.util.ConfigLoader.getInstance(ConfigLoader.java:20)
	at org.juv25d.App.main(App.java:15)
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 4 more
➜  ~  

So Im not sure what the issue was with the JAR to begin with for these changes to be made?
Yesterday tested the initial release v1.0.0-beta both the raw JAR and the docker image and they ran fine before finishing up the deployment.

I had also already updated the maven-jar-plugin to point to the main class and ./mvnw package built a successful manifest and JAR package that could run.

Could you please elaborate on what errors you were facing to make these changes?

Lastly: If we are to keep this release patch, the version tag should not be v1.0.2-beta.
This is still a beta so imo the correct patch version would be v1.0.0-beta.1 or something similar to that.
Until we release a full working version next Thursday then we move back to v1.0.0 -> v1.0.1 etc.

@bamsemats

Copy link
Copy Markdown
Author

Hi, did we plan to make a new release patch already? Our deployment is scheduled on thursdays so not sure if I have missed something? : ) I dont think we should create a patch just for a readme update, that can be saved until next thursday when we have more sufficient progress.

However I can give you my review: 1: We did not need to update the POM version according to Martin, I think I forgot to revert it back to 1.0-SNAPSHOT as it was from the beginning, so maybe we can do that here.

2: This release does not run, and the docker image throws an exception:

~  docker run -p 8080:8080 ghcr.io/ithsjava25/project-webserver-juv25d:v1.0.1-beta            
Exception in thread "main" java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml
	at org.juv25d.util.ConfigLoader.loadConfiguration(ConfigLoader.java:26)
	at org.juv25d.util.ConfigLoader.<init>(ConfigLoader.java:15)
	at org.juv25d.util.ConfigLoader.getInstance(ConfigLoader.java:20)
	at org.juv25d.App.main(App.java:15)
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 4 more
➜  ~  

So Im not sure what the issue was with the JAR to begin with for these changes to be made? Yesterday tested the initial release v1.0.0-beta both the raw JAR and the docker image and they ran fine before finishing up the deployment.

I had also already updated the maven-jar-plugin to point to the main class and ./mvnw package built a successful manifest and JAR package that could run.

Could you please elaborate on what errors you were facing to make these changes?

Lastly: If we are to keep this release patch, the version tag should not be v1.0.2-beta. This is still a beta so imo the correct patch version would be v1.0.0-beta.1 or something similar to that. Until we release a full working version next Thursday then we move back to v1.0.0 -> v1.0.1 etc.

I had not realised we had planned for just weekly updates (since the project is only for two more weeks, that didnt even occur to me to be a thing).

The patch however is not just for the README.md file, but I do agree that it is a minor patch.

According to the error I got when trying to run the .jar file (both locally and through docker, same as you did):

Exception in thread "main" java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml 
at org.juv25d.util.ConfigLoader.loadConfiguration(ConfigLoader.java:26) 
at org.juv25d.util.ConfigLoader.<init>
(ConfigLoader.java:15) 
at org.juv25d.util.ConfigLoader.getInstance(ConfigLoader.java:20) 
at org.juv25d.App.main(App.java:15) 
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml 
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) 
at java.base/java.lang.ClassLoader.loadClass(Unknown Source) 
... 4 more

there was a missing component in the pom.xml that caused us to not build a fat JAR, meaning the SnakeYAML library after install for the execution. I believe this SnakeYAML dependency was not present for the previous release. I'm not sure when the snakeyaml was added to the pom.xml, but it seems it is connected to the configloader.

After testing now, I seem to be able to run the app without the dependency in pom.xml, meaning we shouldn't even need it for the .jar to run...?

If we had decided on a weekly release on Thursdays, we should revert back to the previous release and just keep working on the project in PRs as usual - apologies for the mix-up!

Should I simply remove the latest release?

@fmazmz

fmazmz commented Feb 13, 2026

Copy link
Copy Markdown
Member

The snakeYaml dependency was added by me in #50 to read the application-properties in ConfigLoader. And yes it was not included in the previous release.

Yeah locally your version is running, I also downloaded the JAR from the release and that ran fine, but I think there may have been an issue with how you deployed? Im guessing you created a tag and release manually through github GUI? Cause one thing that stands out to me here is that the docker build ran before your commits was made in this branch.

The docker build workflow ran on Today at 2:14 PM, the release was then created at Today at 2:46 PM, but your first commit / push to this branch was Today at 2:47 PM.

Maybe thats why the JAR and branch work locally, but the docker image was triggered before which means its not in sync with this branch.

Cause the docker workflow is configured to trigger the workflow as soon as we create a new tag.

@fmazmz

fmazmz commented Feb 13, 2026

Copy link
Copy Markdown
Member

No dont worry, for me it is fine if you want to push a patch release and do continues delivery.
I was just thinking of what Martin is expecting and that our team manages to do some work and we get sufficient updates that are worth creating a release for.

However maybe we still need to delete and revert the current release you did and deploy again but fixing the docker image.

My suggestion is to not create a tag in the gh GUI from the main branch.
You can instead push a tag from this branch through git and and that will trigger the build workflow to run here in this PR, after the build is done, then you create a new release on github GUI with the new tag.

That way we can also test everything in this PR before merging !

@bamsemats

Copy link
Copy Markdown
Author

The snakeYaml dependency was added by me in #50 to read the application-properties in ConfigLoader. And yes it was not included in the previous release.

Yeah locally your version is running, but I think there may have been an issue with how you deployed? Im guessing you created a tag and release manually through github GUI? Cause one thing that stands out to me here is that the docker build ran before your commits was made in this branch.

The docker build workflow ran on Today at 2:14 PM, the release was then created at Today at 2:46 PM, but your first commit / push to this branch was Today at 2:47 PM.

Maybe thats why the JAR and branch work locally, but the docker image was triggered before which means its not in sync with this branch.

Cause the docker workflow is triggered to run as soon as you create a new tag.

The version before this fix does not work locally as a .jar, though, since the library required does not get packed with it without this fix to the pom.xml.

I merged the commit, pushed the tag from the terminal, and then I had to go in on github to create the release. I had an error under setup QEMU (which apparently is a common type of error due to some networking error on github /docker hub side), so I had to rerun the task to get it through - maybe this has something to do with the weird timings of the workflow commits?

So the proper process would be to push a branch with a tag and that would get released as soon as it gets merged?

I've never done these types of tasks before, so for me it's all learning-as-I-go (which is still valuable, but quite frustrating).

@fmazmz

fmazmz commented Feb 13, 2026

Copy link
Copy Markdown
Member

Got you, not sure what you mean when you say merged the commit, cause the PR is not merged, so Im taking a guess you meant to say pushed the commit?

And I think then you pushed the tag to main branch right? otherwise we would see the workflow run here which it is not.

Try deleting the tag and the release from github, then re-create and push the tag directly to this branch, I think that would solve the issue.

@fmazmz

fmazmz commented Feb 13, 2026

Copy link
Copy Markdown
Member

if u need any support just ping me and we can get on a call and do it together

@bamsemats

Copy link
Copy Markdown
Author

Got you, not sure what you mean when you say merged the commit, cause the PR is not merged, so Im taking a guess you meant to say pushed the commit?

And I think then you pushed the tag to main branch right? otherwise we would see the workflow run here which it is not.

Try deleting the tag and the release from github, then re-create and push the tag directly to this branch, I think that would solve the issue.

I created the tag on main after I hade merged the latest two commits. After I got the release out and found out there was an error, I created this branch, commited and pushed and created the PR.

@fmazmz

fmazmz commented Feb 13, 2026

Copy link
Copy Markdown
Member

I pushed a tag here now, so we can test the docker image and understand whats going on exactly

@fmazmz

fmazmz commented Feb 13, 2026

Copy link
Copy Markdown
Member

I think I see whats going wrong, the new docker image is not working, which means you did it correctly, but mvn is producing 2 different jars when I run ./mvnw package locally.
And in the docker workflow, it is not built to handle the FAT jar specifically cause we are not specifying the exact jar we want to build, hence Im suspecting its taking the thin jar and not the FAT jar where snakeYaml should be.

I will push a fix

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/main/resources/static/README.md`:
- Line 166: The README's JAR filename is incorrect: it refers to
target/JavaHttpServer-1.0.2-beta.jar but the Maven Shade Plugin sets
<finalName>app</finalName>, so update the README sentence to show the actual
artifact produced (e.g., run with `java -jar target/app.jar`) or else change the
shade plugin's <finalName> to match the README; locate the README line
containing the example command and replace the jar name, or adjust the pom.xml
<finalName> to the README's name so they match.
🧹 Nitpick comments (2)
src/main/resources/static/README.md (1)

39-55: Add language specifiers to fenced code blocks.

Several fenced code blocks lack a language identifier (e.g., the request lifecycle diagram, URL blocks, directory paths). Adding a language hint (e.g., text, yaml, plaintext) satisfies markdownlint MD040 and improves rendering in some Markdown viewers.

Also applies to: 141-143, 156-158, 162-164, 174-176, 269-271, 322-323, 364-366, 370-372, 386-388

pom.xml (1)

161-183: Maven Shade Plugin configuration is correct for producing a fat JAR.

The setup properly bundles dependencies (notably SnakeYAML) into a single JAR, resolving the NoClassDefFoundError referenced in the PR. The finalName=app ensures a predictable artifact name for the Docker build.

Version 3.5.1 (2023) has a newer release available: 3.6.1 (September 2025). Consider updating to the latest version for any recent bug fixes or improvements, though the current version is fully functional.

Comment thread src/main/resources/static/README.md
@fmazmz

fmazmz commented Feb 13, 2026

Copy link
Copy Markdown
Member

it works now, so you can delete the release and tag v1.0.1-beta and create a new release from v1.0.0-beta.2

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 141-143: The fenced code block containing the URL (the
triple-backtick block around "http://localhost:8080") needs a language
specifier; update that block to include a language such as "text" (i.e., change
``` to ```text) so the fenced code block is Markdown-compliant and renders with
explicit language.
- Around line 162-164: The fenced code block containing the URL
"http://localhost:8080" in README.md lacks a language specifier; edit that block
to add a language (e.g., use ```text) before the URL and keep the closing ``` so
the block is labeled and renders correctly.
- Line 166: Update the README note that references the fat JAR filename: replace
the incorrect `JavaHttpServer-<version>.jar` with the actual artifact name
`app.jar` (the Maven Shade Plugin sets `<finalName>app</finalName>`), so the
sentence reads that you can run the project with `java -jar target/app.jar`.

Comment thread README.md
Comment thread README.md
Comment thread README.md Outdated
@bamsemats
bamsemats merged commit b716a70 into main Feb 14, 2026
3 checks passed
@bamsemats

Copy link
Copy Markdown
Author

it works now, so you can delete the release and tag v1.0.1-beta and create a new release from v1.0.0-beta.2

Gonna need you to explain this, but now it's weekend o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants