Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

280
Visualizações
Lombok's annotations in Intellij

I have trouble with using Lombok's annotations, cause it seems like jar wasn't even imported to project:

import lombok.extern.slf4j.Slf4j;

/**
 * Created by John on 2017-03-20.
 */
@Slf4j
public class App {

    public static void main(String[] args)
    {
        log.info("Hello");
    }
}

It says:

Cannot resolve method info(java.lang.String)

When compiling:

Error:(6, 1) java: package org.slf4j does not exist

I did:

  1. Insert lombok's dependency into pom
  2. Installed lombok plugin for Intellij
  3. Enabled annotations processing
  4. Imported dependencies to project (they are on external libs list)

I've looked for a solution here:

  • Lombok added but getters and setters not recognized in Intellij IDEA
  • Can't compile project when I'm using Lombok under IntelliJ IDEA
  • Building with Lombok's @Slf4j and Intellij: Cannot find symbol log

Still the same problem. Any advice would be appriciated.

UPDATE: pom.xml if it helps:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>example</groupId>
    <artifactId>com</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.14</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


</project>
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

You also need to add at least the slf4j-api dependency to your project.

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>${slf4j.version}</version>
</dependency>

Disclosure: I am a Lombok developer.

over 4 years ago · Santiago Trujillo Relatório

0

You need to:

  1. Add lombok to your dependency, and make sure the package is downloaded properly.
  2. Install the lombok plugin for Intellij.
  3. Enable annotation processing in Intellij: Preferences -> Build,Execution,Deployment -> Compiler -> Annotation Processors -> Enable Annotation processing.

  4. Restart Intellij.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda