]> source.dussan.org Git - pf4j.git/commitdiff
Write empty extensions descriptor even if no extensions are found
authorMarcus Ilgner <mail@marcusilgner.com>
Thu, 5 Oct 2023 13:37:38 +0000 (15:37 +0200)
committerGitHub <noreply@github.com>
Thu, 5 Oct 2023 13:37:38 +0000 (16:37 +0300)
pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java

index 66293f8c084b513827089c3c8df3bfb9bdb43427..582414b5a091e9ead53c26527ec517a916eb62a7 100644 (file)
@@ -130,10 +130,10 @@ public class ExtensionAnnotationProcessor extends AbstractProcessor {
             }
         }
 
-        // write extensions
-        if (extensions.size() > 0) {
-            storage.write(extensions);
-        }
+        // Even an empty extensions descriptor is semantically correct and should be
+        // written to prevent classloaders from falling back to extension descriptor
+        // resources from dependencies of the plugin being processed.
+        storage.write(extensions);
 
         return false;
     }