OpenAPITools / OpenAPITools/openapi-generator

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

Open
#13,111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Maven plugin configuration documentation and the enablePostProcessFile option described in the issue. Verify how JAVA_POST_PROCESS_FILE is supplied when running mvn generate-sources, then document the working configuration or clearly state if plugin support is unavailable. Done means a newcomer can configure post-processing without guessing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.