You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
A tiny Maven Plugin that uses [bytecode manipulation](https://github.com/raphw/byte-buddy) to provide automatic implementation of accessors in classes. You can make your class attributes public and the plugin will replace read and write access to them with calls to the corresponding getter and setter method (if existing).
4
4
5
-
## Usage
5
+
## 1. Usage
6
6
7
7
Add the plugin inside the `<build><plugins>` tag of your project's `pom.xml` file:
8
8
@@ -71,7 +71,7 @@ public class Main {
71
71
72
72
You can confirm that by opening the `Main.class` compiled file inside some IDE.
73
73
74
-
## Motivation
74
+
## 2. Motivation
75
75
76
76
JDK 16 introduced the [record type](https://openjdk.org/jeps/395), which are shallowly-immutable classes providing automatic getters and other utilities. However, [records cannot be fully used as JPA entities](https://thorben-janssen.com/java-records-hibernate-jpa/#records-cant-be-entities).
77
77
@@ -84,7 +84,7 @@ Boot;
84
84
- and when the project uses multiple annotation processors, usually we need to [ensure that Lombok is executed first](https://github.com/projectlombok/lombok/issues/973#issuecomment-2537613474).
85
85
86
86
87
-
## How the plugin is different from Lombok
87
+
## 3. How the plugin is different from Lombok
88
88
89
89
Lombok and this plugin perform bytecode manipulation during your project build.
90
90
However, Lombok usually adds new methods that you'll call directly (such as getters and setters).
@@ -124,7 +124,7 @@ This way, even if you remove the plugin, your code still compiles (despite it ma
124
124
That simplifies the build process and avoid Lombok issues that always happen when opening the project on some IDE (even those which have default support for it).
125
125
Who haven't sometime opened a project on IntelliJ and got a lot of errors because of Lombok?
126
126
127
-
## How to remove the plugin
127
+
## 4. How to remove the plugin
128
128
129
129
In order to the plugin from the pom.xml is enough to delete it from your project's pom.xml file.
130
130
Your project will continue building, despite you may not have the same behaviour/results as before.
@@ -133,7 +133,7 @@ you'll need to explicitly call them after removing the plugin.
133
133
134
134
You can automatically do that in your entire project by using the [OpenRewrite tool](https://github.com/openrewrite/rewrite), [which has a Maven Plugin as well](https://docs.openrewrite.org).
135
135
136
-
## Plans for future
136
+
## 5. Plans for future
137
137
138
138
Lombok has some great features. Any feature that just changes existing methods (instead of introducing brand-new ones that you explicitly call) can be implemented.
139
139
Some of them are methods from the `Object` class, such as `toString()`, `equals()`, `hashCode()` etc.
0 commit comments