From 36be69b1c4bd90c8b0704752f9a50323d1dfec2e Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 30 Mar 2025 00:26:14 +0100 Subject: [PATCH] [docs][fixes #3853] Update maven instructions: You need to explicitly specify lombok is an annotation processor. --- website/templates/_download-edge.html | 28 +++++++++++++++++++++++- website/templates/setup/maven.html | 31 ++++++++++++++++----------- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/website/templates/_download-edge.html b/website/templates/_download-edge.html index 0e04596c..7b98d3b2 100644 --- a/website/templates/_download-edge.html +++ b/website/templates/_download-edge.html @@ -10,7 +10,13 @@

Download edge release now!

- You can use the edge release from maven using the projectlombok.org repository:

+				You can use the edge release from maven using the projectlombok.org repository.
+				This requires:
    +
  • Adding the lombok maven repository to your repositories section
  • +
  • Adding lombok as a dependency to your project in the dependencies section, specifying version edge-SNAPSHOT.
  • +
  • Adding lombok as an annotation processor in the annotationProcessorPaths section, specifying version edge-SNAPSHOT.
  • +
+ These sections in your pom file should look like this:
 <repositories>
 	<repository>
 		<id>projectlombok.org</id>
@@ -26,6 +32,26 @@
 		<scope>provided</scope>
 	</dependency>
 </dependencies>
+
+<build>
+	<plugins>
+		<plugin>
+			<groupId>org.apache.maven.plugins</groupId>
+			<artifactId>maven-compiler-plugin</artifactId>
+			<configuration>
+				<annotationProcessorPaths>
+					<path>
+						<groupId>org.projectlombok</groupId>
+						<artifactId>lombok</artifactId>
+						<version>edge-SNAPSHOT</version>
+					</path>
+				</annotationProcessorPaths>
+			</configuration>
+		</plugin>
+	</plugins>
+</build>
+
+

You can use the edge release from gradle using the projectlombok.org repository:

diff --git a/website/templates/setup/maven.html b/website/templates/setup/maven.html
index f6c36822..27153cb3 100644
--- a/website/templates/setup/maven.html
+++ b/website/templates/setup/maven.html
@@ -22,20 +22,25 @@
 </dependencies>
 

- - - <@s.section title="JDK9+ with module-info.java">

- The configuration of the compiler plug-in should contain the following:

-<annotationProcessorPaths>
-	<path>
-		<groupId>org.projectlombok</groupId>
-		<artifactId>lombok</artifactId>
-		<version>${version}</version>
-	</path>
-</annotationProcessorPaths>
-
-

+ You also need to add lombok as an annotation processor. This is mandatory starting with JDK23, or JDK9+ if compiling as modules (you have module-info.java files in your build):
+<build>
+	<plugins>
+		<plugin>
+			<groupId>org.apache.maven.plugins</groupId>
+			<artifactId>maven-compiler-plugin</artifactId>
+			<configuration>
+				<annotationProcessorPaths>
+					<path>
+						<groupId>org.projectlombok</groupId>
+						<artifactId>lombok</artifactId>
+						<version>${version}</version>
+					</path>
+				</annotationProcessorPaths>
+			</configuration>
+		</plugin>
+	</plugins>
+</build>
 	
 	
 	<@s.section title="Eclipse Compiler (ECJ/JDT)">