Introduced configuration properties to include / exclude urls in the 
Classloader.

(cherry picked from commit 021b9ca)


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/76c9698a
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/76c9698a
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/76c9698a

Branch: refs/heads/apache/tomee-7.1.x
Commit: 76c9698a27ccbc4bb5970382846b570dc5f36793
Parents: d84f1cc
Author: Roberto Cortez <[email protected]>
Authored: Fri Mar 9 16:10:56 2018 +0000
Committer: Roberto Cortez <[email protected]>
Committed: Wed Jul 25 18:41:38 2018 +0100

----------------------------------------------------------------------
 .../org/apache/openejb/config/DeploymentLoader.java     | 12 +++++++++---
 .../config/src/test/resources/arquillian.xml            |  1 +
 tomee/tomee-microprofile-webapp/pom.xml                 | 12 ++++++++++++
 3 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/76c9698a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
index 1135c07..d602f81 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
@@ -60,6 +60,7 @@ import org.apache.xbean.finder.UrlSet;
 import org.apache.xbean.finder.archive.ClassesArchive;
 import org.apache.xbean.finder.filter.Filter;
 import org.apache.xbean.finder.filter.Filters;
+import org.apache.xbean.finder.filter.PatternFilter;
 
 import java.io.BufferedInputStream;
 import java.io.File;
@@ -81,6 +82,7 @@ import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
@@ -90,7 +92,6 @@ import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
-import java.util.Locale;
 
 import static java.util.Arrays.asList;
 
@@ -116,6 +117,9 @@ public class DeploymentLoader implements 
DeploymentFilterable {
     private static String ALTDD = 
SystemInstance.get().getOptions().get(OPENEJB_ALTDD_PREFIX, (String) null);
     private volatile List<URL> containerUrls = null;
 
+    private static final String OPENEJB_CONTAINER_INCLUDES = 
"openejb.scan.webapp.container.includes";
+    private static final String OPENEJB_CONTAINER_EXCLUDES = 
"openejb.scan.webapp.container.excludes";
+
     @Deprecated // use load(File, ExternalConfiguration)
     public AppModule load(final File jarFile) throws OpenEJBException {
         return load(jarFile, null);
@@ -1098,13 +1102,15 @@ public class DeploymentLoader implements 
DeploymentFilterable {
 
     private void ensureContainerUrls() {
         if (containerUrls == null) {
-            if 
("true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.scan.webapp.container",
 "false"))) {
+            if 
("true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.scan.webapp.container",
 "true"))) {
                 synchronized (this) {
                     if (containerUrls == null) {
                         try {
                             UrlSet urlSet = new 
UrlSet(ParentClassLoaderFinder.Helper.get());
                             urlSet = URLs.cullSystemJars(urlSet);
-                            urlSet = 
NewLoaderLogic.applyBuiltinExcludes(urlSet);
+                            final PatternFilter containerIncludes = new 
PatternFilter(SystemInstance.get().getProperty(OPENEJB_CONTAINER_INCLUDES, 
".*"));
+                            final PatternFilter containerExcludes = new 
PatternFilter(SystemInstance.get().getProperty(OPENEJB_CONTAINER_EXCLUDES, ""));
+                            urlSet = 
NewLoaderLogic.applyBuiltinExcludes(urlSet, containerIncludes, 
containerExcludes);
                             containerUrls = urlSet.getUrls();
 
                             final boolean skipContainerFolders = 
"true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.scan.webapp.container.skip-folder",
 "true"));

http://git-wip-us.apache.org/repos/asf/tomee/blob/76c9698a/tck/microprofile-tck/config/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/config/src/test/resources/arquillian.xml 
b/tck/microprofile-tck/config/src/test/resources/arquillian.xml
index ecddd0c..d04c730 100644
--- a/tck/microprofile-tck/config/src/test/resources/arquillian.xml
+++ b/tck/microprofile-tck/config/src/test/resources/arquillian.xml
@@ -23,6 +23,7 @@
               http://jboss.org/schema/arquillian/arquillian_1_0.xsd";>
   <container qualifier="tomee-remote" default="true">
     <configuration>
+      <property name="debug">false</property>
       <property name="httpPort">-1</property>
       <property name="ajpPort">-1</property>
       <property name="stopPort">-1</property>

http://git-wip-us.apache.org/repos/asf/tomee/blob/76c9698a/tomee/tomee-microprofile-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/tomee/tomee-microprofile-webapp/pom.xml 
b/tomee/tomee-microprofile-webapp/pom.xml
index 5cb154e..0b68fff 100644
--- a/tomee/tomee-microprofile-webapp/pom.xml
+++ b/tomee/tomee-microprofile-webapp/pom.xml
@@ -37,6 +37,9 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
+    <microprofile.version>1.3</microprofile.version>
+
+    <!-- Geronimo Config 1.1 targets MP Config 1.2 API -->
     <microprofile.config.api.version>1.2</microprofile.config.api.version>
     <microprofile.config.impl.version>1.1</microprofile.config.impl.version>
 
@@ -52,6 +55,15 @@
       <type>war</type>
     </dependency>
 
+    <!-- When we have everything
+    <dependency>
+      <groupId>org.eclipse.microprofile</groupId>
+      <artifactId>microprofile</artifactId>
+      <version>${microprofile.version}</version>
+      <type>pom</type>
+    </dependency>
+    -->
+
     <dependency>
       <groupId>org.eclipse.microprofile.config</groupId>
       <artifactId>microprofile-config-api</artifactId>

Reply via email to