You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/08/11 11:41:00 UTC
[jira] [Created] (OFBIZ-13491) distTar/distZip ships unused Node.js runtime cache, bloating the distribution archive
Mridul Pathak created OFBIZ-13491:
-------------------------------------
Summary: distTar/distZip ships unused Node.js runtime cache, bloating the distribution archive
Key: OFBIZ-13491
URL: https://issues.apache.org/jira/browse/OFBIZ-13491
Project: OFBiz
Issue Type: Bug
Components: framework
Affects Versions: 24.09.07, Upcoming Branch
Reporter: Mridul Pathak
Assignee: Mridul Pathak
build.gradle includes framework/{*},{*} applications/, themes/, plugins/ wholesale in the main distribution — not just source/runtime files. Affects both trunk (build.gradle:147-149) and release24.09 (build.gradle:92-94), which have the same glob.
themes/common-theme applies ofbiz-node-conventions (buildSrc/src/main/groovy/ofbiz-node-conventions.gradle) to run npm install, without overriding node.workDir. The node-gradle plugin's default workDir is <nodeProjectDir>/.gradle/nodejs — inside the swept directory tree — so the downloaded Node.js runtime (~194MB) ends up packaged into ofbiz.tar/zip on both branches, verified by building and inspecting the extracted archive.
On trunk, framework/rest-api also applies ofbiz-node-conventions the same way, doubling the impact (~388MB total). rest-api doesn't exist on release24.09, so that branch only carries the common-theme copy (~194MB).
This cache is never read at runtime — only node_modules (e.g. swagger-ui-dist, redoc/bundles on trunk, common-theme's JS deps on both) is actually needed.
Fix (either):
1. Point node.workDir for the affected subproject(s) to $buildDir or a shared out-of-tree cache.
2. Exclude *{*}/.gradle/{*}* from the distribution's include/exclude filters in root build.gradle.
Impact:
- trunk: ~388MB smaller distribution (~782MB → ~394MB as measured)
- release24.09: ~194MB smaller distribution
No functional change on either branch.
Verification: ./gradlew build -x test -x testIntegration in a clean worktree, extract build/distributions/ofbiz.tar, confirm no .gradle/nodejs dirs in the tree and node_modules is still intact under the affected subproject(s).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)