Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option <extraArgs> to let user pass custom parameters to protoc command #2

Closed
sebastienvermeille opened this issue Aug 4, 2022 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@sebastienvermeille
Copy link
Owner

Add an option to let user pass custom parameters to protoc command

That way we can use all available protoc plugins with their custom options

Applicable Issues
Fixes #61 #77

Description
Add configuration (optional) which is appended in the the protoc command invoked by the maven plugin.
This way we can easily address the issue of wanting to pass some specific parameters to protoc when running the plugin.

In my case I needed to pass some specific plugin arguments:

      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>protodoc</id>
            <goals>
              <goal>compile-custom</goal>
            </goals>
            <configuration>
              <pluginId>protoc-gen-doc</pluginId>
              <pluginExecutable>${project.build.directory}/protoc-plugins/protoc-gen-doc-1.4.1.linux-amd64.go1.15.2/protoc-gen-doc</pluginExecutable>
              <outputDirectory>${project.build.directory}/doc</outputDirectory>
              <extraArgs>--protoc-gen-doc_opt=markdown,README.md</extraArgs>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <protocArtifact>com.google.protobuf:protoc:3.4.0:exe:${os.detected.classifier}</protocArtifact>
        </configuration>
      </plugin>

This way I can pass --protoc-gen-doc_opt=markdown,README.md and everything works fine.

Happy to be able to contribute to a such great project! I stay available for more assistance on it and to discuss it of course thank you 👍

@sebastienvermeille sebastienvermeille added the enhancement New feature or request label Aug 4, 2022
@sebastienvermeille sebastienvermeille added this to the 7.1 milestone Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant