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

radcortez pushed a commit to branch TOMEE-2408
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit de5a2ee7aafe08c4caf20c8ae322cabde5f1cbcf
Author: Roberto Cortez <radcor...@yahoo.com>
AuthorDate: Tue Jan 22 18:50:46 2019 +0000

    TOMEE-2408 - CDI scanning for additional libraries, skipping if to deploy 
only the related ejb module.
---
 .../src/main/java/org/apache/openejb/cdi/CdiScanner.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java 
b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
index b98987a..7b9804b 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
@@ -154,6 +154,13 @@ public class CdiScanner implements BdaScannerService {
 
             final Map<BeansInfo.BDAInfo, 
BeanArchiveService.BeanArchiveInformation> infoByBda = new HashMap<>();
             for (final BeansInfo.BDAInfo bda : beans.bdas) {
+                if (!startupObject.isFromWebApp() &&
+                    ejbJar.webapp &&
+                    !appInfo.webAppAlone &&
+                    bda.uri.toString().contains(ejbJar.path)) {
+                    continue;
+                }
+
                 if (bda.uri != null) {
                     try {
                         beansXml.add(bda.uri.toURL());
@@ -163,6 +170,11 @@ public class CdiScanner implements BdaScannerService {
                 }
                 infoByBda.put(bda, handleBda(startupObject, classLoader, 
comparator, beans, scl, filterByClassLoader, beanArchiveService, openejb, bda));
             }
+
+            if (!startupObject.isFromWebApp() && ejbJar.webapp && 
!appInfo.webAppAlone) {
+                continue;
+            }
+
             for (final BeansInfo.BDAInfo bda : beans.noDescriptorBdas) {
                 // infoByBda.put() not needed since we know it means annotated
                 handleBda(startupObject, classLoader, comparator, beans, scl, 
filterByClassLoader, beanArchiveService, openejb, bda);

Reply via email to