This is an automated email from the ASF dual-hosted git repository. kwin pushed a commit to branch provider-type-check-bnd-plugin in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/provider-type-check-bnd-plugin by this push: new c28a943b Improve logging c28a943b is described below commit c28a943b92bc8dba9947ba7a61ab3a735741f21b Author: Konrad Windszus <k...@apache.org> AuthorDate: Fri Dec 1 13:10:04 2023 +0100 Improve logging Clarify Java 11 requirement --- org.apache.sling.bnd.providertype/readme.md | 3 ++- .../java/org/apache/sling/bnd/providertype/ProviderTypeScanner.java | 6 ++++-- .../org/apache/sling/bnd/providertype/ProviderTypeScannerTest.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/org.apache.sling.bnd.providertype/readme.md b/org.apache.sling.bnd.providertype/readme.md index 87507ddf..d502e59c 100644 --- a/org.apache.sling.bnd.providertype/readme.md +++ b/org.apache.sling.bnd.providertype/readme.md @@ -39,7 +39,8 @@ To explicitly ignore certain provider types (i.e. don't fail when these are exte ## Prerequisites -Bnd 6.0 or newer (integrated in `bnd-maven-plugin` version 6.0.0+ or `maven-bundle-plugin` version 5.1.5+) +* Bnd 6.0 or newer (integrated in `bnd-maven-plugin` version 6.0.0+ or `maven-bundle-plugin` version 5.1.5+) +* Java 11 or newer # Provider Type Information diff --git a/org.apache.sling.bnd.providertype/src/main/java/org/apache/sling/bnd/providertype/ProviderTypeScanner.java b/org.apache.sling.bnd.providertype/src/main/java/org/apache/sling/bnd/providertype/ProviderTypeScanner.java index dfc90dac..e5aa6f82 100644 --- a/org.apache.sling.bnd.providertype/src/main/java/org/apache/sling/bnd/providertype/ProviderTypeScanner.java +++ b/org.apache.sling.bnd.providertype/src/main/java/org/apache/sling/bnd/providertype/ProviderTypeScanner.java @@ -69,12 +69,14 @@ public class ProviderTypeScanner implements AnalyzerPlugin, Plugin { public boolean analyzeJar(Analyzer analyzer) throws Exception { List<Resource> apiInfoJsonResources = analyzer.findResources(s -> s.equals(API_INFO_JSON_RESOURCE_PATH)).collect(Collectors.toList()); if(apiInfoJsonResources.isEmpty()) { - analyzer.warning("Could not find resource \"%s\" exposed from the classpath", API_INFO_JSON_RESOURCE_PATH); + analyzer.warning("Could not find resource \"%s\" in the classpath", API_INFO_JSON_RESOURCE_PATH); } else { Set<String> providerTypes = new HashSet<>(); for (Resource apiInfoJsonResource : apiInfoJsonResources) { try { - providerTypes.addAll(collectProviderTypes(analyzer, apiInfoJsonResource)); + Set<String> resourceProviderTypes = collectProviderTypes(analyzer, apiInfoJsonResource); + analyzer.trace("Added provider types from resource \"%s\": %s", apiInfoJsonResource, String.join(",", resourceProviderTypes)); + providerTypes.addAll(resourceProviderTypes); } catch (Exception e) { throw new IllegalStateException("Could not parse JSON from resource " + apiInfoJsonResource, e); } diff --git a/org.apache.sling.bnd.providertype/src/test/java/org/apache/sling/bnd/providertype/ProviderTypeScannerTest.java b/org.apache.sling.bnd.providertype/src/test/java/org/apache/sling/bnd/providertype/ProviderTypeScannerTest.java index b1319d20..6694e2cc 100644 --- a/org.apache.sling.bnd.providertype/src/test/java/org/apache/sling/bnd/providertype/ProviderTypeScannerTest.java +++ b/org.apache.sling.bnd.providertype/src/test/java/org/apache/sling/bnd/providertype/ProviderTypeScannerTest.java @@ -61,7 +61,7 @@ class ProviderTypeScannerTest { fail(String.join("\n", builder.getErrors())); } List<String> expectedWarnings = Arrays.asList( - "Could not find resource \"META-INF/api-info.json\" exposed from the classpath"); + "Could not find resource \"META-INF/api-info.json\" in the classpath"); assertEquals(expectedWarnings, builder.getWarnings()); } }