Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7436863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:18:29+00:00 2026-05-29T10:18:29+00:00

I thought SLF4J would load org.slf4j.impl.StaticLoggerBinder via reflection but looking at the code in

  • 0

I thought SLF4J would load org.slf4j.impl.StaticLoggerBinder via reflection but looking at the code in org.slf4j.LoggerFactory, it is not the case:

StaticLoggerBinder.getSingleton().getLoggerFactory();

That might suggest that when they packaged the slf4j-api.jar, they had either slf4j-simple.jar (or slf4j-nop.jar) in the classpath, however that would result in a circular dependency as ILoggerFactory interface that the above method returns is defined in slf4j-api.jar.

So, I think when they packaged slf4j-api.jar, they had a stub implementation of StaicLoggerBinder (and other similar classes) which they would compile but then remove the .class files from the jar. Sounds a bit unkosher, doesn’t it?

What kind of build tool would one use to achieve such a result? Specifically, if I am using Maven, how do I build such jars where classes produced during compile time are excluded from the artifact? There could be anonymous and other inner/nested classes being produced too, should they be removed too?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:18:30+00:00Added an answer on May 29, 2026 at 10:18 am

    Take a look at pom.xml and at the sources of slf4j-api.

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <goals>
             <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <tasks>
            <echo>Removing slf4j-api's dummy StaticLoggerBinder and StaticMarkerBinder</echo>
            <delete dir="target/classes/org/slf4j/impl"/>
          </tasks>
        </configuration>
      </plugin>
    

    So, I think when they packaged slf4j-api.jar, they had a stub implementation of StaicLoggerBinder (and other similar classes) which they would compile but then remove the .class files from the jar.

    That’s right and it’s necessary to implement static binding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought people would be working on little code projects together, but I don't
I thought this would be pretty simple, but guess not. I have the following
I thought calling Equals() on two empty Lists would return true, but that's not
I thought this would be pretty academic but its not. I'm trying to traverse
I thought that would have been simple but it is not working. I can,
Thought it was pretty straight forward. But I get a iterator not dereferencable errro
I thought I had this perfectly working but apparently not. I left my project
I thought I would share the workaround I discovered today. It is not possible
I thought I correctly implemented a while loop, but why am I not getting
I thought expressions like this would cause Haskell to evaluate forever. But the behaviors

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.