tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1489168 - /tomee/tomee/trunk/arquillian/arquillian-openejb-embedded-4/src/main/java/org/apache/openejb/arquillian/openejb/OpenEJBArchiveProcessor.java
Date Mon, 03 Jun 2013 20:55:27 GMT
Author: rmannibucau
Date: Mon Jun  3 20:55:27 2013
New Revision: 1489168

URL: http://svn.apache.org/r1489168
Log:
excluding arquillian internal artifact from archive merging in openejb embedded adaptor

Modified:
    tomee/tomee/trunk/arquillian/arquillian-openejb-embedded-4/src/main/java/org/apache/openejb/arquillian/openejb/OpenEJBArchiveProcessor.java

Modified: tomee/tomee/trunk/arquillian/arquillian-openejb-embedded-4/src/main/java/org/apache/openejb/arquillian/openejb/OpenEJBArchiveProcessor.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-openejb-embedded-4/src/main/java/org/apache/openejb/arquillian/openejb/OpenEJBArchiveProcessor.java?rev=1489168&r1=1489167&r2=1489168&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-openejb-embedded-4/src/main/java/org/apache/openejb/arquillian/openejb/OpenEJBArchiveProcessor.java
(original)
+++ tomee/tomee/trunk/arquillian/arquillian-openejb-embedded-4/src/main/java/org/apache/openejb/arquillian/openejb/OpenEJBArchiveProcessor.java
Mon Jun  3 20:55:27 2013
@@ -114,7 +114,10 @@ public class OpenEJBArchiveProcessor {
                         LOGGER.log(Level.SEVERE, "can't add a library to the deployment",
e);
                     }
                 } else if (ArchiveAsset.class.isInstance(asset)) {
-                    archive.merge(((ArchiveAsset) asset).getArchive());
+                    final Archive<?> nestedArchive = ArchiveAsset.class.cast(asset).getArchive();
+                    if (!isExcluded(nestedArchive.getName())) {
+                        archive.merge(nestedArchive);
+                    }
                 }
             }
         } else {
@@ -302,8 +305,13 @@ public class OpenEJBArchiveProcessor {
             final String classname = name(node.getKey().get());
             try {
                 classes.add(cl.loadClass(classname));
-            } catch (ClassNotFoundException e) {
-                e.printStackTrace();
+            } catch (final ClassNotFoundException e) {
+                LOGGER.fine("Can't load class " + classname);
+                if (LOGGER.isLoggable(Level.FINEST)) {
+                    e.printStackTrace(System.err);
+                }
+            } catch (final NoClassDefFoundError ncdfe) {
+                // no-op
             }
         }
 
@@ -335,6 +343,11 @@ public class OpenEJBArchiveProcessor {
         return new SimpleWebappAggregatedArchive(new CompositeArchive(archives), classesByUrl);
     }
 
+    private static boolean isExcluded(final String archiveName) {
+        return "arquillian-junit.jar".equals(archiveName) || "arquillian-protocol.jar".equals(archiveName)
+                || "arquillian-core.jar".equals(archiveName);
+    }
+
     private static String name(final String raw) {
         String name = raw;
         if (name.startsWith(WEB_INF_CLASSES)) {



Mime
View raw message