feat: ability to skip jar output#919
Conversation
WalkthroughAdds a new optional CLI flag (--skip-jar) that propagates to the build command, allowing JAR generation to be skipped. When set, Maven checks are bypassed, jar building is not executed, and resource cleanup behavior is adjusted; otherwise, the existing JAR build and cleanup flow runs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant CLI as CLI (build)
participant KC as keycloakify.command
participant MVN as Maven
participant BJ as buildJars
U->>CLI: run build [--skip-jar]
CLI->>KC: command({ buildContext, skipJar })
alt skipJar = true
KC-->>U: Log "Skipping JAR generation"
note over KC: Maven check bypassed<br/>No jar build<br/>Resources preserved
else skipJar = false
KC->>MVN: Ensure Maven available/installed
KC->>BJ: buildJars(buildContext)
BJ-->>KC: JAR artifacts produced
KC-->>U: Cleanup resources directory
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
3e143e0 to
b7173f8
Compare
add skip-jar flag to skip JAR file build for the build theme command
b7173f8 to
b5150a7
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/bin/keycloakify/keycloakify.ts (2)
13-15: Nit: destructure skipJar with a defaultSlightly cleaner and avoids repeating
params.later.-export async function command(params: { buildContext: BuildContext; skipJar?: boolean }) { - const { buildContext } = params; +export async function command(params: { buildContext: BuildContext; skipJar?: boolean }) { + const { buildContext, skipJar = false } = params;And below:
- if (params.skipJar) { + if (skipJar) {and
- if (params.skipJar) { + if (skipJar) {
124-136: Skip path behavior looks good; consider guarding against stale filesLeaving
resourcesDirPathintact is correct for the flag. If there’s any risk of stale artifacts between runs, optionally pre-clean the directory before regenerating.Example insertion (after
const resourcesDirPath = ...and beforegenerateResources(...)), only if you want a clean slate:if (skipJar && fs.existsSync(resourcesDirPath)) { rmSync(resourcesDirPath, { recursive: true }); }Also optional: clarify the log to mention Maven check is skipped too:
-`⚠️ --skip-jar passed, skipping the jar building step. ${resourcesDirPath} is left intact.` +`⚠️ --skip-jar passed: skipping JAR build and Maven check. ${resourcesDirPath} is left intact.`src/bin/main.ts (1)
71-80: Clarify option descriptionMake the behavior explicit (bypass Maven check, keep resources).
- description: "Skip output JAR file generation.", + description: "Skip JAR generation; bypass Maven check and leave the pre-bundle resources directory intact.",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
src/bin/keycloakify/keycloakify.ts(2 hunks)src/bin/main.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/bin/keycloakify/keycloakify.ts (3)
src/bin/shared/buildContext.ts (1)
BuildContext(26-77)src/bin/keycloakify/buildJars/buildJars.ts (1)
buildJars(19-68)src/bin/tools/fs.rmSync.ts (1)
rmSync(9-34)
src/bin/main.ts (2)
src/bin/keycloakify/keycloakify.ts (1)
command(13-143)src/bin/shared/buildContext.ts (1)
getBuildContext(132-1066)
🔇 Additional comments (3)
src/bin/keycloakify/keycloakify.ts (1)
17-20: LGTM: Maven check correctly bypassed when --skip-jar is setThis aligns with the flag’s intent and improves UX in environments without Maven.
src/bin/main.ts (2)
67-70: LGTM: build command typed to accept skipJarType wiring looks correct.
83-87: LGTM: flag is correctly forwarded to the build commandPropagation is consistent with the new signature.
|
Close and replace by #921 |
Introduce a new flag for build command
--skip-jarto skip output as jar file and leave the pre-bundle folder.I would like to submit this change because We use a different tools to bundle JAR output in our build system.
This will allow little flexibility to bundle the final output.
Summary by CodeRabbit