docs(java-dedup): clarify pom.xml changes are optional#856
Merged
Conversation
- Empirically verified that the Java dedup agent is a pure -javaagent
(Premain-Class only, Can-Redefine-Classes=false,
Can-Retransform-Classes=false), so it does not modify application
bytecode at compile time or retransform at load time. No source-code
or pom.xml changes are required to enable dedup.
- Restructured the "Pre-requisite" section to lead with the runtime-only
requirement (both agent JARs available on disk for -javaagent:) and
present three equivalent ways to obtain the JARs:
A. mvn dependency:copy (no pom edit)
B. direct curl from Maven Central (no Maven required)
C. existing maven-dependency-plugin block in pom.xml (now framed as
optional convenience)
- Verified end-to-end with samples-java/java-dedup: built with
unmodified pom.xml, fetched keploy-sdk.jar via mvn dependency:copy,
ran keploy test --dedup against 400 testcases (400/400 passed),
keploy dedup produced duplicates.yaml with 18 unique / 381 duplicate.
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Java deduplication guide in the v4.0.0 docs to clarify that editing pom.xml is optional and that the Keploy Java agent can be obtained outside the build. It fits the docs codebase by reducing confusion in the Java-specific setup path without changing the actual dedup workflow.
Changes:
- Reworded the Java pre-requisite section to state that dedup uses runtime
-javaagentattachment rather than compile-time bytecode changes. - Added three acquisition paths for
keploy-sdk.jarandjacocoagent.jar: Maven CLI, direct download, or optional Maven plugin automation. - Reframed the existing
maven-dependency-pluginsnippet as an optional convenience instead of a required setup step.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
khareyash05
approved these changes
May 4, 2026
- Reword "retransform classes at load time" to "while classes load" to avoid the Vale.Spelling false positive on "retransform" while keeping the meaning intact. - Replace four em-dashes that had surrounding spaces (Google.EmDash) in the Option A/B/C labels and the Option C explanation. Use a comma for the labels and a semicolon mid-sentence in Option C. - Address Copilot review: prepend `mkdir -p target` to Option B so the curl commands work on a fresh checkout (target/ would not exist yet before the application is built). - Verified locally: vale on the changed file reports 0 errors, 0 warnings, 0 suggestions. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
…dundant notes - Simplified language around the Java agent's bytecode modification, clarifying that no source code or `pom.xml` changes are necessary for deduplication. - Removed unnecessary emphasis on the `-javaagent:` requirement and streamlined the instructions for fetching the required JARs. - Updated the formatting of the Option A section for clarity. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
…uctions - Fixed spacing inconsistencies in the Java deduplication documentation, particularly around the `-javaagent:` requirement and the Option A section. - Ensured clarity and consistency in the presentation of instructions without altering the content. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
ceb0b42 to
e63e9cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What has changed?
The "For Java Applications" section under
keploy-cloud/deduplication.mdpreviously read as if themaven-dependency-pluginblock was a required step to enable dynamic deduplication. That framing prompted users to ask whether the change forced them to recompile their app or alter their build pipeline. It does not — the Keploy Java agent is a pure-javaagent(Premain-Classonly,Can-Redefine-Classes=false,Can-Retransform-Classes=false) that attaches at JVM startup and does not modify application bytecode at compile time or retransform classes at load time.This PR rewrites the Pre-requisite subsection of the Java instructions to make that explicit and to present three equivalent ways to obtain the agent JARs:
mvn dependency:copy(nopom.xmledit)curlfrom Maven Central (no Maven required)maven-dependency-pluginblock, now framed as an optional convenience for users who prefer their build to copy the JARs automaticallyEverything from "Run the app with both agents attached" onward (build configuration, Dockerfile, run commands) is unchanged.
This PR Resolves #(no issue — surfaced via user question)
Type of change
How Has This Been Tested?
This change was driven by an empirical end-to-end run against
samples-java/java-dedupon macOS (Docker Desktop 28.5.1, Keploy Enterprise 3.2.74-ff7ac305):samples-java/java-dedup/pom.xmlto its checked-in state and confirmeddiffwas empty against the original throughout.mvn -B -DskipTests clean package— no-Dkeploy.agent.version=…, so the sample'scopy-keploy-agentprofile never activated. The build producedtarget/java-dedup.jarandtarget/jacocoagent.jaronly; nokeploy-sdk.jar.mvn dependency:copy -Dartifact=io.keploy:keploy-sdk:2.0.6 -DoutputDirectory=target -Dmdep.stripVersion=true— nopom.xmledit.docker compose buildproduced the runtime image with both agent JARs and the existing entrypoint.keploy test -c "docker compose up" --container-name "dedup-java" --dedup --language java --delay 15 --disableMockUpload --disableReportUpload→ 400/400 testcases passed across all four testsets.keploy dedup --path .→ producedduplicates.yaml; Keploy reported 18 unique / 381 duplicate out of 399 testcases analyzed.diff pom.xml pom.xml.bak→ empty (pom.xml byte-for-byte unchanged the entire time).I have not run
npm run build/npm run serveagainst this branch, since the change is markdown content only (no sidebar, frontmatter, link, or config change) and limited to a single existing file. Happy to attach screenshots from a local Docusaurus build if reviewers want them — just ping.Checklist: