xolstice / protobuf-maven-plugin

Maven Plugin that executes the Protocol Buffers (protoc) compiler
https://www.xolstice.org/protobuf-maven-plugin/
Other
232 stars 76 forks source link

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

Closed sebastienvermeille closed 1 year ago

sebastienvermeille commented 3 years ago

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 :+1:

bfmyr4 commented 2 years ago

Any chance on getting this into a new release?

annyugen commented 2 years ago

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

sebastienvermeille commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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

sebastienvermeille commented 1 year ago

@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