From cf708a3f8ceea2226b506b5c351b31c971afc52b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 00:53:54 +0200 Subject: [PATCH] [MCHECKSTYLE-447] Bump org.codehaus.plexus:plexus-resources from 1.1.0 to 1.3.0 (#129) - [Release notes](https://github.com/codehaus-plexus/plexus-resources/releases) - [Commits](https://github.com/codehaus-plexus/plexus-resources/compare/plexus-resources-1.1.0...plexus-resources-1.3.0) ... Signed-off-by: dependabot[bot] Co-authored-by: Sylwester Lachiewicz --- pom.xml | 8 +------- .../resource/LicenseResourceManager.java | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 6714e3a1..57333fbd 100644 --- a/pom.xml +++ b/pom.xml @@ -159,13 +159,7 @@ under the License. org.codehaus.plexus plexus-resources - 1.1.0 - - - org.codehaus.plexus - plexus-container-default - - + 1.3.0 org.codehaus.plexus diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/resource/LicenseResourceManager.java b/src/main/java/org/apache/maven/plugins/checkstyle/resource/LicenseResourceManager.java index 8808867c..800b97c6 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/resource/LicenseResourceManager.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/resource/LicenseResourceManager.java @@ -18,6 +18,8 @@ */ package org.apache.maven.plugins.checkstyle.resource; +import javax.inject.Inject; + import java.util.Map; import org.codehaus.plexus.component.annotations.Component; @@ -28,6 +30,8 @@ import org.codehaus.plexus.resource.loader.ResourceLoader; import org.codehaus.plexus.resource.loader.ResourceNotFoundException; import org.codehaus.plexus.resource.loader.ThreadContextClasspathResourceLoader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * License resource manager, to avoid defaulting license to maven-checkstyle-plugin's own license. @@ -37,9 +41,16 @@ @Component(role = ResourceManager.class, hint = "license", instantiationStrategy = "per-lookup") public class LicenseResourceManager extends DefaultResourceManager { + private static final Logger LOGGER = LoggerFactory.getLogger(LicenseResourceManager.class); + @Requirement(role = ResourceLoader.class) private Map resourceLoaders; + @Inject + public LicenseResourceManager(Map resourceLoaders) { + super(resourceLoaders); + } + @Override public void addSearchPath(String id, String path) { ResourceLoader loader = resourceLoaders.get(id); @@ -64,13 +75,12 @@ public PlexusResource getResource(String name) throws ResourceNotFoundException try { PlexusResource resource = resourceLoader.getResource(name); - getLogger().debug("The resource '" + name + "' was found as " + resource.getName() + "."); + LOGGER.debug("The resource '" + name + "' was found as " + resource.getName() + "."); return resource; } catch (ResourceNotFoundException e) { - getLogger() - .debug("The resource '" + name + "' was not found with resourceLoader " - + resourceLoader.getClass().getName() + "."); + LOGGER.debug("The resource '" + name + "' was not found with resourceLoader " + + resourceLoader.getClass().getName() + "."); } }