@@ -158,7 +158,16 @@ Of course if you don't want to build locally you can grab artifacts from maven c
158158
159159### Maven BOM
160160
161- To manage Swagger dependencies consistently across modules, import the Swagger Core BOM and omit versions on individual Swagger dependencies:
161+ The ` swagger-bom ` artifact is a Bill of Materials that manages ** both** the ` javax ` and Jakarta (` -jakarta ` suffix) artifact families.
162+ Import it once and omit versions on all individual Swagger dependencies.
163+
164+ > ** Note:** Maven and Gradle build plugins (` swagger-maven-plugin ` , ` swagger-gradle-plugin ` ,
165+ > ` swagger-eclipse-transformer-maven-plugin ` ) are intentionally ** excluded** from the BOM.
166+ > Plugins are applied via ` <build><plugins> ` or ` plugins {} ` , not via ` <dependencyManagement> ` ,
167+ > so including them in the BOM would be misleading and could conflict with the plugin
168+ > management section of a consumer's build.
169+
170+ #### Maven
162171
163172``` xml
164173<dependencyManagement >
@@ -171,11 +180,11 @@ To manage Swagger dependencies consistently across modules, import the Swagger C
171180 <scope >import</scope >
172181 </dependency >
173182 </dependencies >
174-
175183</dependencyManagement >
176184
177- <!-- Then declare Swagger dependencies without versions -->
185+ <!-- Then declare Swagger dependencies without explicit versions -->
178186<dependencies >
187+ <!-- javax artifacts -->
179188 <dependency >
180189 <groupId >io.swagger.core.v3</groupId >
181190 <artifactId >swagger-annotations</artifactId >
@@ -196,7 +205,6 @@ To manage Swagger dependencies consistently across modules, import the Swagger C
196205 <groupId >io.swagger.core.v3</groupId >
197206 <artifactId >swagger-jaxrs2</artifactId >
198207 </dependency >
199- <!-- Optional servlet initializer helpers -->
200208 <dependency >
201209 <groupId >io.swagger.core.v3</groupId >
202210 <artifactId >swagger-jaxrs2-servlet-initializer</artifactId >
@@ -205,14 +213,58 @@ To manage Swagger dependencies consistently across modules, import the Swagger C
205213 <groupId >io.swagger.core.v3</groupId >
206214 <artifactId >swagger-jaxrs2-servlet-initializer-v2</artifactId >
207215 </dependency >
208- <!-- Optional support for Java 17 module-path consumers -->
209216 <dependency >
210217 <groupId >io.swagger.core.v3</groupId >
211218 <artifactId >swagger-java17-support</artifactId >
212219 </dependency >
220+ <!-- Jakarta namespace artifacts (use instead of, or alongside, the javax ones above) -->
221+ <dependency >
222+ <groupId >io.swagger.core.v3</groupId >
223+ <artifactId >swagger-annotations-jakarta</artifactId >
224+ </dependency >
225+ <dependency >
226+ <groupId >io.swagger.core.v3</groupId >
227+ <artifactId >swagger-models-jakarta</artifactId >
228+ </dependency >
229+ <dependency >
230+ <groupId >io.swagger.core.v3</groupId >
231+ <artifactId >swagger-core-jakarta</artifactId >
232+ </dependency >
233+ <dependency >
234+ <groupId >io.swagger.core.v3</groupId >
235+ <artifactId >swagger-integration-jakarta</artifactId >
236+ </dependency >
237+ <dependency >
238+ <groupId >io.swagger.core.v3</groupId >
239+ <artifactId >swagger-jaxrs2-jakarta</artifactId >
240+ </dependency >
241+ <dependency >
242+ <groupId >io.swagger.core.v3</groupId >
243+ <artifactId >swagger-jaxrs2-servlet-initializer-jakarta</artifactId >
244+ </dependency >
245+ <dependency >
246+ <groupId >io.swagger.core.v3</groupId >
247+ <artifactId >swagger-jaxrs2-servlet-initializer-v2-jakarta</artifactId >
248+ </dependency >
213249</dependencies >
214250```
215251
252+ #### Gradle
253+
254+ ``` kotlin
255+ dependencies {
256+ implementation(platform(" io.swagger.core.v3:swagger-bom:${swaggerOpenapiv3Version} " ))
257+
258+ // javax artifacts — no version needed
259+ implementation(" io.swagger.core.v3:swagger-annotations" )
260+ implementation(" io.swagger.core.v3:swagger-core" )
261+
262+ // Jakarta namespace artifacts — no version needed
263+ implementation(" io.swagger.core.v3:swagger-annotations-jakarta" )
264+ implementation(" io.swagger.core.v3:swagger-core-jakarta" )
265+ }
266+ ```
267+
216268## Sample Apps
217269The samples have moved to [ a new repository] ( https://github.com/swagger-api/swagger-samples/tree/2.0 ) and contain various integrations and configurations.
218270
0 commit comments