From 0f31c62806f000516f4cdef1bfa87cf22c362130 Mon Sep 17 00:00:00 2001
From: Roel Spilker
+ The import
directive was added in lombok 1.18.12.
@f.history>
<@f.overview>
@@ -111,4 +112,55 @@
Turning either of these options on means lombok will make every field in every source file final and/or private unless it has an explicit access modifier or annotation to suppress this. See the @FieldDefaults
documentation for more.
+ At the top of a configuration file it is possible to import other configuration files. Imported files don't have to be called lombok.config
and can have any file extension (or even none).
+
import ../configuration/model.config
+
+ For shared projects, it makes sense to always use relative paths. For individuals, it is also possible to use absolute paths.
+
# Linux
import /etc/lombok/model.config
# Windows
import d:/lombok/model.config
+
+ Configuration files can import multiple configuration files as long as they are specified before any configuration key.
+ The system behaves as if the contents of the imported file is at the location of the import
declaration.
+
+ The way the configuration system works is that duplicate entries are effectively ignored. It is a last-wins. Lombok will only + process a configuration file once when resolving a specific value. This allows you to import the same files from different + configuration files, and even create loops without any problems. +
+
+ It is also possible to import files from .jar
and .zip
files.
+
# Use 'lombok.config' from the root of the archive.
import ../deps/lombok-config.jar
# Use a given file in the archive.
import ../deps/lombok-config.zip!base/model.config
+
+ When importing files, it is possible to use environment variables.
+
# Environment variables are names surrounded by angle brackets (<, >).
# They are replaced by System.getenv(name), if present.
import <JAVA_PROJECTS>/shared.config>
# A tilde (~) at the start gets replaced by System.getProperty("user.home", "~").
import ~/my.config
+