Skip to content

Commit

Permalink
[MCHECKSTYLE-447] Bump org.codehaus.plexus:plexus-resources from 1.1.…
Browse files Browse the repository at this point in the history
…0 to 1.3.0 (#129)

- [Release notes](https://github.com/codehaus-plexus/plexus-resources/releases)
- [Commits](codehaus-plexus/plexus-resources@plexus-resources-1.1.0...plexus-resources-1.3.0)

...
Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: Sylwester Lachiewicz <slachiewicz@apache.org>
  • Loading branch information
dependabot[bot] and slachiewicz authored Mar 31, 2024
1 parent 34fcf3e commit cf708a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand All @@ -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<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);
Expand All @@ -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() + ".");
}
}

Expand Down

0 comments on commit cf708a3

Please sign in to comment.