Skip to content

common4j: don't tie sourcesJar/javadocJar to assemble#3115

Closed
fadidurah wants to merge 1 commit into
devfrom
fadi/optimize-common4j-build-perf
Closed

common4j: don't tie sourcesJar/javadocJar to assemble#3115
fadidurah wants to merge 1 commit into
devfrom
fadi/optimize-common4j-build-perf

Conversation

@fadidurah
Copy link
Copy Markdown
Contributor

Why

common4j (the first library built in our pipeline) currently takes ~52 minutes per build. Investigation surfaced that we run javadoc generation on every CI flow because it's wired into the assemble task graph, even when the flow only needs to compile, run tests, or run spotbugs. Generating javadoc for common4j is one of the slower individual tasks in the build.

What

Drop assemble.dependsOn sourcesJar, javadocJar from common4j/build.gradle.

These two tasks are already wired into the publish graph through components.java + the maven-publish plugin, so they still run automatically as part of publish (which is what creates them in our published artifact). They just no longer run when we only assemble.

Risk

Very low. Local developers who explicitly want the source/javadoc jars on disk can still run ./gradlew sourcesJar javadocJar. The published artifact is unchanged.

Companion PR

1ES-Pipelines (ADO PR — link to be added) adds Cache@2 tasks for ~/.gradle/caches, --build-cache --parallel flags, and combines spotbugs + publish into a single Gradle invocation.

These tasks are already wired into the publish graph through
components.java + the maven-publish plugin, so they will be
generated automatically when publish runs.

Tying them to assemble made every CI flow that just compiles or
runs tests also build javadoc, which is one of the slowest tasks
in the common4j build. Local developers who want the artifacts
can still run ./gradlew sourcesJar javadocJar explicitly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@fadidurah fadidurah requested a review from a team as a code owner May 14, 2026 19:47
Copilot AI review requested due to automatic review settings May 14, 2026 19:47
@fadidurah
Copy link
Copy Markdown
Contributor Author

Folding into existing PR #3113 instead.

@fadidurah fadidurah closed this May 14, 2026
@fadidurah fadidurah deleted the fadi/optimize-common4j-build-perf branch May 14, 2026 19:48
@github-actions
Copy link
Copy Markdown

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

@fadidurah fadidurah review requested due to automatic review settings May 14, 2026 20:10
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.

1 participant