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


The following commit(s) were added to refs/heads/master by this push:
     new a946ed1  [OWB-1328] ensure we don't silently fail when we can't scan 
an url
a946ed1 is described below

commit a946ed113b3f7d900753c43a17529900c738d088
Author: Romain Manni-Bucau <rmannibu...@gmail.com>
AuthorDate: Sat Jun 13 13:21:17 2020 +0200

    [OWB-1328] ensure we don't silently fail when we can't scan an url
---
 .../webbeans/corespi/scanner/AbstractMetaDataDiscovery.java    | 10 +++++++++-
 1 file changed, 9 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 2139362..700435c 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
@@ -286,7 +286,15 @@ public abstract class AbstractMetaDataDiscovery implements 
BdaScannerService
             {
                 // we could check for META-INF/maven/org.apache.geronimo.specs 
presence there but this is faster
                 File file = Files.toFile(url);
-                if(file!= null && file.exists()) 
+                if (file == null)
+                {
+                    throw new IllegalArgumentException(
+                            "URL not supported (only jar and file are 
supported by this impl): " + url + ". " +
+                            "Ensure to use a compatible implementation of " +
+                            BdaScannerService.class.getName() + " or " +
+                            "add the url to 
org.apache.webbeans.scanExclusionPaths in openwebbeans.properties.");
+                }
+                if (file.exists())
                 {
                     final String filename = file.getName();
                     if (filename.startsWith("geronimo-") && 
filename.contains("_spec"))

Reply via email to