You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -164,6 +167,9 @@ To allow any level of nesting it is possible to create `*<nested/>*` option maps
164
167
165
168
<8> `*<goal/>*` **goal** (mandatory): this is the goal maven should run. Since the plugin does only have a single goal the value is always `process`.
166
169
170
+
<9> `*<addSourceRoot/>*` **addSourceRoot* (optional): this defaults to `true` and automatically adds the `targetDir` as compile source root folder. It can be disabled by setting it to `false`.
171
+
172
+
=== multiple processors
167
173
168
174
To run a second processor add another `<execution>` element. Here is an example that configures xref:spring:ROOT:index.adoc[openapi-processor-spring] and xref:json:ROOT:index.adoc[openapi-processor-json]:
169
175
@@ -244,67 +250,30 @@ With this configuration maven will use it when directly running the `process` go
244
250
245
251
== using the processor output
246
252
247
-
So far the plugin processes the given openapi yaml and writes the output to the given target directory but maven ignores the output.
248
-
249
-
It is necessary to tell maven to use the generated files. In case of generated java source files maven should compile them. The *build-helper-maven-plugin* is used to for this:
Starting with the release 2024.1 it is no longer necessary to manually add the generated sources to the build. The plugin will automatically add the `targetDir` as compile source root.
282
256
283
-
This tells the *build-helper-maven-plugin* to add the processors `targetDir` as an additional source folder to the project.
257
+
It can be disabled by setting the plugin configuration `<addSourceRoot>` to `false`.
284
258
285
-
Maven will now include the generated files when it compiles the project.
259
+
=== resource files
286
260
287
-
If the output of the processor (e.g. generated by openapi-processor-json) should be used as resource the *build-helper-maven-plugin* has a goal for this too. Just add another `<excecution/>` using the `add-resource` goal:
261
+
If the output of the processor (e.g. generated by openapi-processor-json) should be used as resource add a resource directory.
0 commit comments