This is an automated email from the ASF dual-hosted git repository.
deepak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 157e1cdc20 Skip creating empty plugins directory and handle missing
directory gracefully
157e1cdc20 is described below
commit 157e1cdc20864775ab85cf1e11f1a23b073cfa3d
Author: Deepak Dixit <[email protected]>
AuthorDate: Tue Oct 28 01:02:29 2025 +0530
Skip creating empty plugins directory and handle missing directory
gracefully
- Removed unnecessary mkdir /plugins from common.gradle.
- Updated build.gradle to skip processing when pluginsDir does not exist.
- Added a check to ensure component directory existence before listing
subdirectories.
- This prevents creating empty plugin directories and avoids unnecessary
log noise when the folder is missing.
---
build.gradle | 7 ++++++-
common.gradle | 7 ++++---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/build.gradle b/build.gradle
index cb1eec5747..5c383262f7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -665,7 +665,12 @@ task generateAllPluginsDocumentation(group: docsGroup,
description: 'Generate all plugins documentation.') {
dependsOn deleteAllPluginsDocumentation
- file("${pluginsDir}").eachDir { plugin ->
+ File pluginsDirectory = file(pluginsDir)
+ if (!pluginsDirectory.exists()) {
+ println("Plugins directory not found.")
+ return
+ }
+ pluginsDirectory.eachDir { plugin ->
activeComponents().each { component ->
if (component.name == plugin.name) {
if (subprojectExists(":plugins:${plugin.name}")) {
diff --git a/common.gradle b/common.gradle
index 9764df0e01..3c7db5020d 100644
--- a/common.gradle
+++ b/common.gradle
@@ -19,8 +19,6 @@
import java.util.stream.Stream
import java.util.stream.Collectors
-mkdir "${rootDir}/plugins"
-
// The ‘file’ argument can be either a string or a file.
Stream<Node> xmlChildren(file) {
new XmlParser().parse(file).children().stream()
@@ -46,7 +44,10 @@ List<File> activeComponents() {
if (loader.exists()) {
xmlChildren(loader).map { file dir + '/' +
it.@'component-location' }
} else {
- subdirs file(dir)
+ File componentDir = file(dir)
+ if (componentDir.exists()) {
+ subdirs componentDir
+ }
}
})
.filter(this.&isComponentEnabled)