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 #79

Closed
wants to merge 42 commits into from

Conversation

sebastienvermeille
Copy link

@sebastienvermeille sebastienvermeille commented May 5, 2021

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 👍

…otoc command

That way we can use all available protoc plugins with their custom options
@bfmyr4
Copy link

bfmyr4 commented Jan 13, 2022

Any chance on getting this into a new release?

@annyugen
Copy link

Also curious on this update. Really love to have this so I can configure NullAway to not scan generated classes

@sebastienvermeille
Copy link
Author

Hi, okay it seems that this project is no longer maintained, I will fork it and host it on maven myself. @nguyenAn1201 @bfmyr4 sorry for the delay, I will ping you when it's ready if you still need it :)

@seime
Copy link

seime commented Feb 15, 2022

Hi @sebastienvermeille , are you intending to become the new maintainer if this project, and by that review and merge PRs? If so I applaud you, and we're happy to switch to your releases when available.

Cheers

@sebastienvermeille
Copy link
Author

@seime Yes it's on my plans but unfortunately lack a bit of time.

If you need this PR code in your projects I hosted it already on maven central:

<dependency>
  <groupId>dev.cookiecode</groupId>
  <artifactId>protobuf-maven-plugin</artifactId>
  <version>0.7.1</version>
  <type>maven-plugin</type>
</dependency>

@seime
Copy link

seime commented Sep 6, 2022

@seime Yes it's on my plans but unfortunately lack a bit of time.

If you need this PR code in your projects I hosted it already on maven central:

Thanks @sebastienvermeille , we have switched to your fork. Looking forward to next releases!

@sergei-ivanov
Copy link
Member

@sebastienvermeille would you like to officially take over the project as a principal committer?

@sebastienvermeille
Copy link
Author

@sergei-ivanov yes would be great as it's a central lib for many other projects I would like to do that for sure.
Let's have a talk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Allow Providing Parameters to Built in Plugin
5 participants