Lombok does not work on the IntelligentJ Maven project

已回答

First of all, Lombok works well on the source code.

 

 

 

But I keep getting this error

 

java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate. Use build process "jps.track.ap.dependencies" VM flag to enable/disable incremental annotation processing environment.


java: No processor claimed any of these annotations: NoArgsConstructor,ResponseBody,Scheduled,Controller,RequestParam,Getter,ModelAttribute,RequestMapping,Autowired,Component,AllArgsConstructor,Service,Data,SessionAttribute,Setter,Param

 

 

plugins ok

 

 

 

both pom.xml - dependency OK

(I also changed it to 1.18.20, 1.18.22 but it didn't work the same way)

 

 

 

annotation processors - ok

 

 

and

I tried rebuilding, invalidating and restarting, but it didn't work


 

 

 

What's the problem?
I wasted 30 hours because of this

 

 

 

 

 

 

 


 

 

 

0
I couldn't reproduce the issue with a simple test. Does it help if you clean the maven local repo(~/.m2/repository) and run `mvn clean compile` ?
0

Thank you for your answer. As you said, I deleted the Lombok folder in the local storage, 

But 

it was not recognized on the source code, so I got a button to add Lombok to the target. So when I added it, it started to recognize it again on the source code, but if you run it the same way
'java: No processor claimed any of these annotations: NoArgsConstructor,ResponseBody,Scheduled,Controller,RequestParam,Getter,ModelAttribute,RequestMapping,Autowired,Component,AllArgsConstructor,Service,Data,SessionAttribute,Setter,Param
'
I see this error again…😭😭

0
Will you be able to create a sample project ?
0

https://github.com/jeongmin-Lee0321/MIAA
*branch - development

It is recognized in new projects, but it only happens in the current project... This happens only when loading from IntelliJ.

0

Still not reproducible from my side… Can you find lombok in the external library in the project window? Also, check the scope in project structure dialogue. Please upload the zipped log file(Help→Collect Logs and Diagnostic Data) to https://uploads.jetbrains.com.

0

Thank you so much for your continued help..

As shown in the picture above, I changed the Lombok to 'provided' and 'comply' in the module, but it doesn't work 😭


and I uploaded it as you said, is there anything else I should do?

0

Hi. Is the following option enabled in your IDE? If not, does it help if you enable it and restart?

-1

I have exactly the same behaviour with lombok 1.18.32, intellij 2024.1.5, bundled maven (3.9.6) and jdk 21.

 

I have annotation processing, lombok plugin and the lombok check box checked (I also tried to remove it as I have above 1.18.16 but it did not change anything)   

 

Also tried with jdk 17, external maven 3.9.6 or external 3.8.8…

 

 

1
Hi, could you please share more details of the issue you met? Like what's in the code, and what's the expected result, and what's the actual result?
0

Delete .idea files in from your project and restart intellij. When you run your application using Run As or Debug As Intellij will popup notification to enable Annotation processor, enable it and it works !!!

-1

Running 2024.1.7 with a Maven Java 11 project and I now have the same issue as expressed above where the “log” object appeared as not recognized by Intellij. It's compiling fine and I can still release this project but it is showing errors everywhere for no reason. 

1

Hello,

Have you tried to run “File | Invalidate Caches”? Also, you may try to remove .idea folder and .iml file and reimport project again.

Is it reproducible with some sample project that could be provided for investigation?

0

hmm, I created this repo and tried it intellij and it just worked using java 23 and bundled maven 3.9.9
 

https://github.com/Lance-Uppercut/lombok-annotations-error

Perhaps one of the other guys can try to reproduce the error using that repo and share experiences?

I added my compilation configuration from my original repo.


and this intellij version

IntelliJ IDEA 2024.3 (Community Edition)
Build #IC-243.21565.193, built on November 13, 2024
Runtime version: 21.0.5+8-b631.16 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4080M
Cores: 8
Registry:
 analyze.exceptions.on.the.fly=true
 ide.experimental.ui=true
 i18n.locale=
Non-Bundled Plugins:
 com.github.mikesafonov.jenkins-linter-idea-plugin (0.6.0)
 dev.meanmail.plugin.nginx-intellij-plugin (2024.3)
 Lombook Plugin (243.21565.193)
 gherkin (243.21565.122)
 cucumber-java (243.21565.129)
 Docker (243.21565.204)
 org.jetbrains.plugins.gitlab (243.21565.204)
 io.nimbly.tzatziki (17.10.0)
 org.sonarlint.idea (10.12.0.79769)
Kotlin: 243.21565.193-IJ
 

-1

Invalidating the cache made it for me thanks for your help guys

-1

I have wasted my 10 hours because of Lombok isn't working. I did all the requirements. When i manuelly add constructors etc it worked but with Lombok… Naaah

0

This is due to issue in your pom.xml

 

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <optional>true</optional>
</dependency>

 

 

<build>
    <plugins>
       <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <configuration>
             <excludes>
                <exclude>
                   <groupId>org.projectlombok</groupId>
                   <artifactId>lombok</artifactId>
                </exclude>
             </excludes>
          </configuration>
       </plugin>
    </plugins>
</build>

 

This will work

 

3

Vikum Perera , Can you please elaborate?

The first snippet needs to be removed and the second one needs to be added?

Currently I can see that both are present in my pom.xml

I am also facing the same issue where Lombok isn't working for one of the services in my mono-repo application but is working perfectly fine for others.

 

0

Got it resolved finally!

Apparently for a mono-repo application with multiple services, annotation processors should be enabled only for the parent application folder which contains the services and not for the individual services. In my case, for one of the services it was activated, hence Lombok was not working for that particular service.

After disabling the annotation processing for the service, it compiled without any issues.

0

For anyone facing this issue. Click "Annotation profile for spring". Then check the “Obtain processors…”

8

Permanasibarani007  thanks worked for me also 

0

worked for me as well. i have already set this but it turned out to be in default. we have to explicitly select “annotation profile for spring” and set the settings as shown.

0

for intellij

if you use IntelliJ,  Install Lombok and enable the plugin from the market place. After that check your pom.xml file that you have build and dependency code as below.

"

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <optional>true</optional>
</dependency>


<build>
    <plugins>
       <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
       </plugin>
    </plugins>
</build>

"

 

for Eclipse 

if you use Eclipse, don't have to install anything just check your pom.xml file for the below build and dependency code

"
<dependency>

     <groupId>org.projectlombok</groupId>

     <artifactId>lombok</artifactId>

     <optional>true</optional>

</dependency>

<build>
    <plugins>
       <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <configuration>
             <excludes>
                <exclude>
                   <groupId>org.projectlombok</groupId>
                   <artifactId>lombok</artifactId>
                </exclude>
             </excludes>
          </configuration>
       </plugin>
    </plugins>
</build>

"


 

 

0

Thank you Vikum Perera

It worked for me!!!

0

请先登录再写评论。