You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "timtebeek (via GitHub)" <gi...@apache.org> on 2024/11/16 21:19:03 UTC

[PR] refactor: Replace Plexus AbstractLogEnabled with SLF4J [maven-checkstyle-plugin]

timtebeek opened a new pull request, #157:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/157

   As seen on https://cwiki.apache.org/confluence/plugins/servlet/mobile?contentId=181305684#MavenEcosystemCleanup-DropPlexusContainerforJSR-330+SisuGuiceextension
   
   - Leverages https://github.com/openrewrite/rewrite-apache/pull/41
   
   I have another two lined up for apache/maven and apache/maven-archetype that I'll verify first.
   
   @elharo if you wouldn't mind, could you look this over?
   
   Use this link to re-run the recipe: https://app.moderne.io/builder/P4zH7djn6?organizationId=QXBhY2hlIE1hdmVu


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Replace Plexus AbstractLogEnabled with SLF4J [maven-checkstyle-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo merged PR #157:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/157


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Replace Plexus AbstractLogEnabled with SLF4J [maven-checkstyle-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on PR #157:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/157#issuecomment-2543069508

   Run 'mvn spotless:apply' to fix these violations.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Replace Plexus AbstractLogEnabled with SLF4J [maven-checkstyle-plugin]

Posted by "timtebeek (via GitHub)" <gi...@apache.org>.
timtebeek commented on code in PR #157:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/157#discussion_r1851766019


##########
src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java:
##########
@@ -51,20 +51,23 @@
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.resource.ResourceManager;
 import org.codehaus.plexus.resource.loader.FileResourceCreationException;
 import org.codehaus.plexus.resource.loader.FileResourceLoader;
 import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
 import org.codehaus.plexus.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Olivier Lamy
  * @since 2.5
  *
  */
 @Component(role = CheckstyleExecutor.class, hint = "default", instantiationStrategy = "per-lookup")
-public class DefaultCheckstyleExecutor extends AbstractLogEnabled implements CheckstyleExecutor {
+public class DefaultCheckstyleExecutor implements CheckstyleExecutor {
+    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCheckstyleExecutor.class);

Review Comment:
   Ah I had changed that in 0ee70f2b235015b7fb85c7555eed54a5c07fe9a8 after Checkstyle complained locally; makes sense not to use uppercase, but then we might need to change checkstyle.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Replace Plexus AbstractLogEnabled with SLF4J [maven-checkstyle-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #157:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/157#discussion_r1851740306


##########
src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java:
##########
@@ -51,20 +51,23 @@
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.resource.ResourceManager;
 import org.codehaus.plexus.resource.loader.FileResourceCreationException;
 import org.codehaus.plexus.resource.loader.FileResourceLoader;
 import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
 import org.codehaus.plexus.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Olivier Lamy
  * @since 2.5
  *
  */
 @Component(role = CheckstyleExecutor.class, hint = "default", instantiationStrategy = "per-lookup")
-public class DefaultCheckstyleExecutor extends AbstractLogEnabled implements CheckstyleExecutor {
+public class DefaultCheckstyleExecutor implements CheckstyleExecutor {
+    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCheckstyleExecutor.class);

Review Comment:
   LOGGER is not a named constant and should be logger instead of LOGGER. See https://stackoverflow.com/questions/1417190/should-a-static-final-logger-be-declared-in-upper-case



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Replace Plexus AbstractLogEnabled with SLF4J [maven-checkstyle-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #157:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/157#discussion_r1851802875


##########
src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java:
##########
@@ -51,20 +51,23 @@
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.resource.ResourceManager;
 import org.codehaus.plexus.resource.loader.FileResourceCreationException;
 import org.codehaus.plexus.resource.loader.FileResourceLoader;
 import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
 import org.codehaus.plexus.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Olivier Lamy
  * @since 2.5
  *
  */
 @Component(role = CheckstyleExecutor.class, hint = "default", instantiationStrategy = "per-lookup")
-public class DefaultCheckstyleExecutor extends AbstractLogEnabled implements CheckstyleExecutor {
+public class DefaultCheckstyleExecutor implements CheckstyleExecutor {
+    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCheckstyleExecutor.class);

Review Comment:
   Let's change checkstyle rules then. If it's complaining on this, it's wrong.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Replace Plexus AbstractLogEnabled with SLF4J [maven-checkstyle-plugin]

Posted by "timtebeek (via GitHub)" <gi...@apache.org>.
timtebeek commented on code in PR #157:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/157#discussion_r1876722927


##########
src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java:
##########
@@ -51,20 +51,23 @@
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.resource.ResourceManager;
 import org.codehaus.plexus.resource.loader.FileResourceCreationException;
 import org.codehaus.plexus.resource.loader.FileResourceLoader;
 import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
 import org.codehaus.plexus.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Olivier Lamy
  * @since 2.5
  *
  */
 @Component(role = CheckstyleExecutor.class, hint = "default", instantiationStrategy = "per-lookup")
-public class DefaultCheckstyleExecutor extends AbstractLogEnabled implements CheckstyleExecutor {
+public class DefaultCheckstyleExecutor implements CheckstyleExecutor {
+    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCheckstyleExecutor.class);

Review Comment:
   Thanks for the review! Picked up in https://github.com/apache/maven-checkstyle-plugin/pull/157/commits/bc1665009162135424ea9f4d4a0a31ce9ef351ea



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Replace Plexus AbstractLogEnabled with SLF4J [maven-checkstyle-plugin]

Posted by "timtebeek (via GitHub)" <gi...@apache.org>.
timtebeek commented on PR #157:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/157#issuecomment-2543225133

   Apologies! Fixed now and `mvn veriry` shows no issues.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org