mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 10:18:46 +00:00
Document Ant annotation processing on JDK 23
This commit is contained in:
1 parent
c934a838a9
commit
ad8a656158
1 file changed
+10
-1
@@ -5,7 +5,7 @@
|
||||
<p>
|
||||
This page explains how to compile your code when you use the <a href="https://ant.apache.org/">Apache Ant</a> build tool. We suggest you use <a href="http://ant.apache.org/ivy/">ivy</a>, the ant add-on that lets you fetch dependencies from the internet automatically.
|
||||
</p><p>
|
||||
Lombok just needs to be on the classpath when you compile your code to do its work, so all you have to ensure, is that lombok is on the classpath in your <code><javac></code> task.
|
||||
Lombok needs to be available when you compile your code to do its work. For non-modular builds on JDK22 and below, it is enough to put lombok on the classpath in your <code><javac></code> task. On JDK23 and above, you also need to enable annotation processing explicitly.
|
||||
</p>
|
||||
</@s.introduction>
|
||||
|
||||
@@ -14,6 +14,13 @@
|
||||
Assuming that you've put <code>lombok.jar</code> in a <code>lib</code> dir, your javac task would have to look like:<pre>
|
||||
<javac srcdir="src" destdir="build" source="1.8">
|
||||
<classpath location="lib/lombok.jar" />
|
||||
</javac></pre>
|
||||
</p><p>
|
||||
When compiling with JDK23 or newer, you also need to enable annotation processing explicitly, for example by adding lombok to the processor path:<pre>
|
||||
<javac srcdir="src" destdir="build" source="1.8">
|
||||
<classpath location="lib/lombok.jar" />
|
||||
<compilerarg value="-processorpath" />
|
||||
<compilerarg path="lib/lombok.jar" />
|
||||
</javac></pre>
|
||||
</p>
|
||||
</@s.section>
|
||||
@@ -24,6 +31,8 @@
|
||||
<dependencies>
|
||||
<dependency org="org.projectlombok" name="lombok" rev="${version}" conf="build->master" />
|
||||
</dependencies></pre>
|
||||
</p><p>
|
||||
When compiling with JDK23 or newer, make sure the ivy-resolved lombok jar is also passed to javac as an annotation processor path, or enable annotation processing explicitly with <code>-proc:full</code>.
|
||||
</p>
|
||||
</@s.section>
|
||||
</@s.scaffold>
|
||||
Reference in new issue
Block a user