lombok.config, IntelliJ IDEA and multi-module Maven projects

3,777 views
Skip to first unread message

Misagh Moayyed

unread,
Sep 2, 2014, 11:53:36 AM9/2/14
to project...@googlegroups.com
I have got a question about the configuration and placement of the lombok.config file that hopefully is small to resolve.

I am working with a multi-module Maven project that is loaded inside the IntelliJ IDEA IDE. 

  • I have placed the lombok Maven dependency into the parent pom of the project
  • I have also created the lombok.config file at the root of my project directory in the parent folder, right next to the parent pom. 
  • I have set both "config.stopBubbling = true" and "lombok.log.fieldName = 'logger'" inside the configuration.

Then, inside a Java class in one of the maven submodule projects, I added the annotation "@Slf4j" and I can see that a "log" field is generated, but I was expecting "logger" to show up. I am not sure what I have to do in order to have lombok load the configuration file. 

Any suggestions?

Regards,
Misagh

Misagh

unread,
Sep 4, 2014, 4:30:51 AM9/4/14
to project...@googlegroups.com
Any thoughts or suggestions on how I can apply the configuration system to change the logger field? Not been able to make any progress. I should note that I am using Oracle JDK7. 


--
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.



--
-Misagh

Michail Plushnikov

unread,
Sep 4, 2014, 7:09:28 AM9/4/14
to project...@googlegroups.com
Hello Misagh,

lombok.config files are currently not supported by lombok-intellij-plugin.

Misagh

unread,
Sep 5, 2014, 1:54:34 AM9/5/14
to project...@googlegroups.com
Thanks for the response.

To be exact, I am not yet using the lombok-intellij-plugin. All I have done is add the maven dependency for lombok, and the config file and the annotation. That's all. 

I take it, that should work with any IDE? or am I missing something here?

In retrospect it perhaps would be easier to define loggers, if I could do @Slf4j(name="logger") or something to that effect.

Roel Spilker

unread,
Oct 24, 2014, 5:25:55 AM10/24/14
to project...@googlegroups.com
We've decided to not use this syntax for two reasons:
1) You can use the default "log"
2) If you have a very good reason not to, you can change it for all @Slf4j occurrences on the configuration system
3) "name" would be confusing; it could also mean the name of the logger, not of the field

Misagh Moayyed

unread,
Oct 24, 2014, 2:59:59 PM10/24/14
to project...@googlegroups.com

Well:

 

1)      Both slf4j and Logback seem to use “logger” in their examples, which I would take to be the recommended variable name as a convention.  But that’s not big deal. I understand opinions vary on this.

2)      This is impractical, if you are dealing with very large codebases like I am. (The noise that it would produce in the commit log just to get one piece working without anything functionally relevant would more than likely be rejected upon code review and/or discussions).

3)      I am not prejudiced towards that syntax; anything that would make it clearer would be fine with me.

 

 

I guess my biggest issue is, the intellij plugin does not support loading the configuration system. So without that support,  I was hoping to be able to do the config right in the annotation syntax, and without that even, I simply won’t be able to use lombok at all which is sad news all around.




This email is free from viruses and malware because avast! Antivirus protection is active.


Reply all
Reply to author
Forward
0 new messages