Skip to content

docs(java-dedup): clarify pom.xml changes are optional#856

Merged
officialasishkumar merged 4 commits into
mainfrom
docs/java-dedup-pom-optional
May 4, 2026
Merged

docs(java-dedup): clarify pom.xml changes are optional#856
officialasishkumar merged 4 commits into
mainfrom
docs/java-dedup-pom-optional

Conversation

@officialasishkumar

Copy link
Copy Markdown
Contributor

What has changed?

The "For Java Applications" section under keploy-cloud/deduplication.md previously read as if the maven-dependency-plugin block 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-Class only, 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:

  • Option A — one-off fetch with mvn dependency:copy (no pom.xml edit)
  • Option B — direct curl from Maven Central (no Maven required)
  • Option C — the existing maven-dependency-plugin block, now framed as an optional convenience for users who prefer their build to copy the JARs automatically

Everything 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

  • Documentation update (if none of the other choices apply).

How Has This Been Tested?

This change was driven by an empirical end-to-end run against samples-java/java-dedup on macOS (Docker Desktop 28.5.1, Keploy Enterprise 3.2.74-ff7ac305):

  1. Restored samples-java/java-dedup/pom.xml to its checked-in state and confirmed diff was empty against the original throughout.
  2. Built with mvn -B -DskipTests clean packageno -Dkeploy.agent.version=…, so the sample's copy-keploy-agent profile never activated. The build produced target/java-dedup.jar and target/jacocoagent.jar only; no keploy-sdk.jar.
  3. Fetched the agent purely out-of-band via mvn dependency:copy -Dartifact=io.keploy:keploy-sdk:2.0.6 -DoutputDirectory=target -Dmdep.stripVersion=true — no pom.xml edit.
  4. docker compose build produced the runtime image with both agent JARs and the existing entrypoint.
  5. keploy test -c "docker compose up" --container-name "dedup-java" --dedup --language java --delay 15 --disableMockUpload --disableReportUpload400/400 testcases passed across all four testsets.
  6. keploy dedup --path . → produced duplicates.yaml; Keploy reported 18 unique / 381 duplicate out of 399 testcases analyzed.
  7. 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 serve against 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:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.

- 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>
Copilot AI review requested due to automatic review settings May 4, 2026 12:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 -javaagent attachment rather than compile-time bytecode changes.
  • Added three acquisition paths for keploy-sdk.jar and jacocoagent.jar: Maven CLI, direct download, or optional Maven plugin automation.
  • Reframed the existing maven-dependency-plugin snippet as an optional convenience instead of a required setup step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread versioned_docs/version-4.0.0/keploy-cloud/deduplication.md
- 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>
@officialasishkumar officialasishkumar force-pushed the docs/java-dedup-pom-optional branch from ceb0b42 to e63e9cd Compare May 4, 2026 14:51
@officialasishkumar officialasishkumar merged commit 5c88544 into main May 4, 2026
7 checks passed
@officialasishkumar officialasishkumar deleted the docs/java-dedup-pom-optional branch May 4, 2026 14:56
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