Skip to content

Commit 9ea4338

Browse files
authored
fix(velocity): explicitly add the annotation processor in Maven (#709)
* fix(velocity): explicitly add the annotation processor in Maven * fix: copy paste error * fix: split Maven versions
1 parent 0573a10 commit 9ea4338

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed

src/content/docs/velocity/dev/getting-started/creating-your-first-plugin.mdx

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,49 @@ system's documentation ([Gradle](https://docs.gradle.org/current/userguide/userg
9090
}
9191
```
9292
</TabItem>
93-
<TabItem label="Maven">
93+
<TabItem label="Maven 4+">
94+
:::caution
95+
96+
If you're using JDK 23 or later, you must add the annotation processor manually to your `pom.xml`, as described in the example.
97+
See the [Maven documentation](https://maven.apache.org/plugins/maven-compiler-plugin-4.x/examples/annotation-processor.html) for more information.
98+
99+
:::
100+
101+
```xml title="pom.xml" replace
102+
<project>
103+
<repositories>
104+
<repository>
105+
<id>papermc</id>
106+
<url>https://repo.papermc.io/repository/maven-public/</url>
107+
</repository>
108+
</repositories>
109+
110+
<dependencies>
111+
<dependency>
112+
<groupId>com.velocitypowered</groupId>
113+
<artifactId>velocity-api</artifactId>
114+
<version>\{LATEST_VELOCITY_RELEASE}</version>
115+
<scope>provided</scope>
116+
</dependency>
117+
<!-- add the annotation processor -->
118+
<dependency>
119+
<groupId>com.velocitypowered</groupId>
120+
<artifactId>velocity-api</artifactId>
121+
<version>\{LATEST_VELOCITY_RELEASE}</version>
122+
<type>processor</type>
123+
</dependency>
124+
</dependencies>
125+
</project>
126+
```
127+
</TabItem>
128+
<TabItem label="Maven 3">
129+
:::caution
130+
131+
If you're using JDK 23 or later, you must add the annotation processor manually to your `pom.xml`, as described in the example.
132+
See the [Maven documentation](https://maven.apache.org/plugins/maven-compiler-plugin-4.x/examples/annotation-processor.html) for more information.
133+
134+
:::
135+
94136
```xml title="pom.xml" replace
95137
<project>
96138
<repositories>
@@ -108,6 +150,25 @@ system's documentation ([Gradle](https://docs.gradle.org/current/userguide/userg
108150
<scope>provided</scope>
109151
</dependency>
110152
</dependencies>
153+
154+
<build>
155+
<plugins>
156+
<plugin>
157+
<groupId>org.apache.maven.plugins</groupId>
158+
<artifactId>maven-compiler-plugin</artifactId>
159+
<configuration>
160+
<!-- add the annotation processor -->
161+
<annotationProcessorPaths>
162+
<path>
163+
<groupId>com.velocitypowered</groupId>
164+
<artifactId>velocity-api</artifactId>
165+
<version>\{LATEST_VELOCITY_RELEASE}</version>
166+
</path>
167+
</annotationProcessorPaths>
168+
</configuration>
169+
</plugin>
170+
</plugins>
171+
</build>
111172
</project>
112173
```
113174
</TabItem>

0 commit comments

Comments
 (0)