openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] Add missing documentation on how to configure Java post-processing with maven plugin

Open ostrya opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

I am currently using the maven plugin to generate Java code, but right now, the code does not match the formatting rules of my repository. According to the documentation, I should be able to configure a post-processing step by setting the plugin configuration option 'enablePostProcessFile' and setting the environment property 'JAVA_POST_PROCESS_FILE'. But I have no idea how to set this environment property from within the plugin configuration so the post-processing happens every time I run 'mvn generate-sources'.

I tried to set JAVA_POST_PROCESS_FILE as an environment variable within the plugin like this:

<configuration>
	<!-- remaining config is skipped -->
	<enablePostProcessFile>true</enablePostProcessFile>
	<environmentVariables>
		<JAVA_POST_PROCESS_FILE>echo "foo"</JAVA_POST_PROCESS_FILE>
	</environmentVariables>
</configuration>

but the plugin still says that JAVA_POST_PROCESS_FILE is not set.

Describe the solution you'd like

Please document how post-processing can be configured within the maven plugin configuration.

Describe alternatives you've considered

If it is in fact not possible to just configure a post-processing script, please consider supporting it, e.g. by adding a new configuration option like this:

<configuration>
	<!-- remaining config is skipped -->
	<enablePostProcessFile>true</enablePostProcessFile>
	<configOptions>
		<javaPostProcessFile>echo "foo"</javaPostProcessFile>
	</configOptions>
</configuration>

ostrya avatar Aug 05 '22 09:08 ostrya