This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git

commit c3afd10c07f7938416d0dc4c6a6601c19d3b0fe0
Author: Romain Manni-Bucau <rmannibu...@gmail.com>
AuthorDate: Wed Dec 8 19:23:03 2021 +0100

    [OWB-1395] fixing scanning when there is a beans.xml
---
 .../webbeans/corespi/scanner/AbstractMetaDataDiscovery.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
 
b/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
index 002e81e..777abc4 100644
--- 
a/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
+++ 
b/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
@@ -232,7 +232,16 @@ public abstract class AbstractMetaDataDiscovery implements 
BdaScannerService
                 }
                 else
                 {
-                    final URL url = 
classpathFiles.remove(Files.toFile(beansXmlUrl));
+                    File key = Files.toFile(beansXmlUrl);
+                    URL url = classpathFiles.remove(key);
+                    if (url == null &&
+                            "beans.xml".equals(key.getName()) &&
+                            key.getParentFile() != null &&
+                            "META-INF".equals(key.getParentFile().getName()))
+                    {
+                        key = key.getParentFile().getParentFile();
+                        url = classpathFiles.remove(key);
+                    }
                     if (url != null)
                     {
                         addDeploymentUrl(beansXmlUrl.toExternalForm(), url);

Reply via email to