Open friesey opened 10 years ago
Seems to me like a IDE problem.
Problem persists over SEVEN YEARS later! The "LOG.info(...) recognizes LOG
(defined in lombok.config
) but not theinfo()
method. I'm using IntelliJ CE (2021.3.1) with Gradle 7.3 under macOS 12.1.
...
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/users")
@Slf4j
public class UserController {
@Autowired
private UserService userService;
@PostMapping("/")
public User saveUser(@RequestBody User user) {
LOG.info("POST {}", user);
return userService.saveUser(user);
}
...
When I "build" this I get
java: package org.slf4j does not exist
even though the code actually runs with the proper logging.
It's not working for me either.
When cloning the project/repository in my local IDE (community version of IntelliJ), the libraries concerning slf4j seems to be missing. Is there something to be done concerning the pom.xml file or add some jar to my local classpath?