Skip to content

Commit 3bb982d

Browse files
refactor: Replace Plexus AbstractLogEnabled with SLF4J (#338)
* 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]>
1 parent 76826c8 commit 3bb982d

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

pom.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ under the License.
286286
<version>2.1.0</version>
287287
</dependency>
288288

289+
<dependency>
290+
<groupId>org.slf4j</groupId>
291+
<artifactId>slf4j-api</artifactId>
292+
<version>${slf4jVersion}</version>
293+
</dependency>
294+
289295
<!-- Plexus -->
290296
<dependency>
291297
<groupId>org.codehaus.plexus</groupId>
@@ -403,12 +409,6 @@ under the License.
403409
<version>3.26.3</version>
404410
<scope>test</scope>
405411
</dependency>
406-
<dependency>
407-
<groupId>org.slf4j</groupId>
408-
<artifactId>slf4j-api</artifactId>
409-
<version>${slf4jVersion}</version>
410-
<scope>test</scope>
411-
</dependency>
412412
<dependency>
413413
<groupId>org.slf4j</groupId>
414414
<artifactId>slf4j-simple</artifactId>

src/main/java/org/apache/maven/plugins/javadoc/resolver/ResourceResolver.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,24 @@
5454
import org.codehaus.plexus.archiver.UnArchiver;
5555
import org.codehaus.plexus.archiver.manager.ArchiverManager;
5656
import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
57-
import org.codehaus.plexus.logging.AbstractLogEnabled;
5857
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
5958
import org.eclipse.aether.RepositorySystem;
6059
import org.eclipse.aether.RepositorySystemSession;
6160
import org.eclipse.aether.graph.DefaultDependencyNode;
6261
import org.eclipse.aether.graph.DependencyFilter;
6362
import org.eclipse.aether.resolution.ArtifactRequest;
6463
import org.eclipse.aether.resolution.ArtifactResult;
64+
import org.slf4j.Logger;
65+
import org.slf4j.LoggerFactory;
6566

6667
/**
6768
*
6869
*/
6970
@Named
7071
@Singleton
71-
public final class ResourceResolver extends AbstractLogEnabled {
72+
public final class ResourceResolver {
73+
private static final Logger LOGGER = LoggerFactory.getLogger(ResourceResolver.class);
74+
7275
@Inject
7376
private RepositorySystem repoSystem;
7477

@@ -220,8 +223,8 @@ private List<JavadocBundle> resolveBundlesFromArtifacts(
220223
try {
221224
dirs = resolveAndUnpack(toResolve, config, RESOURCE_VALID_CLASSIFIERS, false);
222225
} catch (ArtifactResolutionException | ArtifactNotFoundException e) {
223-
if (getLogger().isDebugEnabled()) {
224-
getLogger().debug(e.getMessage(), e);
226+
if (LOGGER.isDebugEnabled()) {
227+
LOGGER.debug(e.getMessage(), e);
225228
}
226229
}
227230

0 commit comments

Comments
 (0)