Skip to content

Commit

Permalink
refactor: Replace Plexus AbstractLogEnabled with SLF4J (#338)
Browse files Browse the repository at this point in the history
* refactor: Replace Plexus AbstractLogEnabled with SLF4J

Use this link to re-run the recipe: https://app.moderne.io/builder/P4zH7djn6?organizationId=QXBhY2hlIE1hdmVu

Co-authored-by: Moderne <[email protected]>

* Move `slf4j-api` to compile scope now that we no longer log using Plexus

* Fix checkstyle violation

---------

Co-authored-by: Moderne <[email protected]>
  • Loading branch information
timtebeek and TeamModerne authored Nov 17, 2024
1 parent 76826c8 commit 3bb982d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ under the License.
<version>2.1.0</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
</dependency>

<!-- Plexus -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down Expand Up @@ -403,12 +409,6 @@ under the License.
<version>3.26.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,24 @@
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.graph.DefaultDependencyNode;
import org.eclipse.aether.graph.DependencyFilter;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
*
*/
@Named
@Singleton
public final class ResourceResolver extends AbstractLogEnabled {
public final class ResourceResolver {
private static final Logger LOGGER = LoggerFactory.getLogger(ResourceResolver.class);

@Inject
private RepositorySystem repoSystem;

Expand Down Expand Up @@ -220,8 +223,8 @@ private List<JavadocBundle> resolveBundlesFromArtifacts(
try {
dirs = resolveAndUnpack(toResolve, config, RESOURCE_VALID_CLASSIFIERS, false);
} catch (ArtifactResolutionException | ArtifactNotFoundException e) {
if (getLogger().isDebugEnabled()) {
getLogger().debug(e.getMessage(), e);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(e.getMessage(), e);
}
}

Expand Down

0 comments on commit 3bb982d

Please sign in to comment.