You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2024/03/31 22:53:59 UTC

(maven-checkstyle-plugin) branch master updated: [MCHECKSTYLE-447] Bump org.codehaus.plexus:plexus-resources from 1.1.0 to 1.3.0 (#129)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new cf708a3  [MCHECKSTYLE-447] Bump org.codehaus.plexus:plexus-resources from 1.1.0 to 1.3.0 (#129)
cf708a3 is described below

commit cf708a3f8ceea2226b506b5c351b31c971afc52b
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Mon Apr 1 00:53:54 2024 +0200

    [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] <su...@github.com>
    
    Co-authored-by: Sylwester Lachiewicz <sl...@apache.org>
---
 pom.xml                                                |  8 +-------
 .../checkstyle/resource/LicenseResourceManager.java    | 18 ++++++++++++++----
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6714e3a..57333fb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -159,13 +159,7 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-resources</artifactId>
-      <version>1.1.0</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.codehaus.plexus</groupId>
-          <artifactId>plexus-container-default</artifactId>
-        </exclusion>
-      </exclusions>
+      <version>1.3.0</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
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 8808867..800b97c 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.ResourceManager;
 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 @@ import org.codehaus.plexus.resource.loader.ThreadContextClasspathResourceLoader;
 @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<String, ResourceLoader> resourceLoaders;
 
+    @Inject
+    public LicenseResourceManager(Map<String, ResourceLoader> resourceLoaders) {
+        super(resourceLoaders);
+    }
+
     @Override
     public void addSearchPath(String id, String path) {
         ResourceLoader loader = resourceLoaders.get(id);
@@ -64,13 +75,12 @@ public class LicenseResourceManager extends DefaultResourceManager {
             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() + ".");
             }
         }