@Slf4j on 1.16.2 compilation error (Cannot find symbol)

3,089 views
Skip to first unread message

nyo

unread,
Mar 14, 2015, 3:55:56 PM3/14/15
to project...@googlegroups.com
I have a maven project with the following pom deps:
          <dependency>
                   <groupId>org.projectlombok</groupId>
                   <artifactId>lombok</artifactId>
                   <version>1.16.2</version>
                   <scope>provided</scope>
        </dependency>
        <dependency>
                   <artifactId>logback-core</artifactId>
                   <groupId>ch.qos.logback</groupId>
                   <version>1.1.2</version>
         </dependency>
         <dependency>
                   <artifactId>logback-classic</artifactId>
                    <groupId>ch.qos.logback</groupId>
                    <version>1.1.2</version>
          </dependency>
          <dependency>
                   <groupId>org.slf4j</groupId>
                   <artifactId>slf4j-api</artifactId>
                   <version>1.7.10</version>
           </dependency>

During compilation (JDK8), if I use something like:

log.warn("asd");

I get the following error:

error: cannot find symbol

It's obviously a regression issue cause the same seems to work if I was to change to 1.12.4. Also, If I was to use

private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Object.class);

I have no problem. So, to sum it up:

@Slf4j annotation, latest libs, JDK 1.8.0-ea. On 1.12.4 Lombok it works.

Reinier Zwitserloot

unread,
May 15, 2015, 6:27:10 AM5/15/15
to project-lombok
Sounds like you have a lombok.config somewhere renaming the log field away from 'log' and towards something else. 1.12.4 doesn't have the config system yet so it would ignore that setting. If it had been a dependency issue you'd get a different error. Try running delombok on it and see the name of the field lombok generates.

 --Reinier Zwitserloot

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages