Skip to content

Commit e67639c

Browse files
committed
document new dependencies block to configure processor dependencies
1 parent 350661c commit e67639c

1 file changed

Lines changed: 32 additions & 34 deletions

File tree

docs/modules/ROOT/pages/index.adoc

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ a Gradle plugin based on the link:{oap-api}[openapi-processor-api] to handle any
2727
| minimum Gradle version
2828
| minimum Java version
2929

30-
| 2026.x, 2025.x
30+
| 2026.2+
31+
| 8.7+
32+
| 17
33+
34+
| 2026.1, 2025.x
3135
| 8.2+ with kotlin dsl +
3236
7.2+ with groovy dsl
3337
| 17
@@ -47,7 +51,7 @@ NOTE: In case the generated source should be formatted with google code format,
4751

4852
== Gradle dsl
4953

50-
An xref:spring:ROOT:index.adoc[openapi-processor-spring] spring specific description is available in xref:spring:ROOT:gradle.adoc[Gradle Integration].
54+
// An xref:spring:ROOT:index.adoc[openapi-processor-spring] spring specific description is available in xref:spring:ROOT:gradle.adoc[Gradle Integration].
5155

5256
The plugin adds a new configuration block `openapiProcessor` to the Gradle project. Each processor is configurable by a nested configuration block.
5357

@@ -164,33 +168,15 @@ openapiProcessor {
164168

165169
The configuration of a single processor has a few pre-defined properties, and it can have any number of additional parameters defined by the processor. All options will be passed in a map to the processor with the option name as the key.
166170

167-
* `processor` (mandatory): the `processor` dependency. Uses the same dependency notations allowed in the gradle `dependencies` block.
168-
+
169-
The processor library is configured here to avoid any side effect on the build dependencies of the project.
171+
* `dependencies { process(...) }` (mandatory, [.badge .badge-since]+since 2025.1+): the processor dependency(ies).
170172
+
171-
Example using the preferred shortcut nation:
172-
+
173-
[tabs]
174-
====
175-
Kotlin::
173+
This is a Gradle custom `dependencies` block. It accepts all dependency notations that the standard Gradle `dependencies` block accepts.
176174
+
177-
[source,kotlin]
178-
----
179-
process("spring") {
180-
processor("io.openapiprocessor:openapi-processor-spring:<version>")
181-
}
182-
----
183-
Groovy::
175+
The processor library is configured here to avoid any side effect on the build dependencies of the project.
184176
+
185-
[source,groovy]
186-
----
187-
spring {
188-
processor 'io.openapiprocessor:openapi-processor-spring:<version>'
189-
}
190-
----
191-
====
177+
NOTE: This replaces the obsolete dependency configuration using `processor` (which still works). The new configuration is using standard Gradle APIs.
192178
+
193-
or like this to use an unpublished processor:
179+
Example using the preferred shortcut nation:
194180
+
195181
[tabs]
196182
====
@@ -199,29 +185,32 @@ Kotlin::
199185
[source,kotlin]
200186
----
201187
process("spring") {
202-
processor(files("... path to processor jar"))
188+
dependencies {
189+
process("io.openapiprocessor:openapi-processor-spring:<version>")
190+
}
203191
}
204192
----
205193
Groovy::
206194
+
207195
[source,groovy]
208196
----
209197
spring {
210-
processor files('... path to processor jar')
198+
dependencies {
199+
processor 'io.openapiprocessor:openapi-processor-spring:<version>'
200+
}
211201
}
212202
----
213203
====
214-
215204
+
216-
It is possible to use multiple `processor` entries to control the dependencies of an openapi-processor.
205+
It is possible to use multiple `process` entries to control the dependencies of an openapi-processor.
217206
+
218207
For example, the java generating processors depend on `openapi-processor-core`. The `core` library provides most of the logic of a processor, and it is usually enough to update the `core` library to get bugfixes or new features.
219208
+
220209
[NOTE]
221210
====
222211
To find 'SNAPSHOT' versions, the plugin automatically adds the snapshot repository to the `repositories`.
223212
224-
[.badge .badge-since]+since 2022.2+ In case you don't want this, it is possible to disable adding the snapshot repository by adding `openapi-processor-gradle.snapshots = false` to `gradle.properties`).
213+
In case you don't want this, it is possible to disable adding the snapshot repository by adding `openapi-processor-gradle.snapshots = false` to `gradle.properties`).
225214
====
226215
+
227216
[tabs]
@@ -231,20 +220,29 @@ Kotlin::
231220
[source,kotlin]
232221
----
233222
process("spring") {
234-
processor("io.openapiprocessor:openapi-processor-core:2026.3-SNAPSHOT")
235-
processor("io.openapiprocessor:openapi-processor-spring:2026.2")
223+
dependencies {
224+
processor("io.openapiprocessor:openapi-processor-spring:2026.2")
225+
processor("io.openapiprocessor:openapi-processor-core:2026.2.1")
226+
}
236227
}
237228
----
238229
Groovy::
239230
+
240231
[source,groovy]
241232
----
242233
spring {
243-
processor 'io.openapiprocessor:openapi-processor-core:2026.3-SNAPSHOT'
244-
processor 'io.openapiprocessor:openapi-processor-spring:2026.2'
234+
dependencies {
235+
processor 'io.openapiprocessor:openapi-processor-spring:2026.2'
236+
processor 'io.openapiprocessor:openapi-processor-core:2026.2.1'
237+
}
245238
}
246239
----
247240
====
241+
242+
* `processor` (obsolete): the `processor` dependency. Uses the same dependency notations allowed in the gradle `dependencies` block.
243+
+
244+
NOTE: it does still work but will go away in a future version in favor of the configuration in the processor specific `dependencies` block.
245+
248246
* `apiPath` (optional): the path to the open api YAML file. If set inside a processor configuration it overrides the parent `apiPath`.
249247

250248
* `targetDir` (mandatory): the target folder for the processor. The processor will write its output to this directory.

0 commit comments

Comments
 (0)