xolstice / protobuf-maven-plugin

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

Use lite code generation #64

Closed hpehl closed 4 years ago

hpehl commented 5 years ago

I'm looking for a way to use the lite variant when generating the Java source code. According to the documentation one has to use something like

protoc --java_out=lite:${OUTPUT_DIR} path/to/your/proto/file

I'm wondering whether and how this can be used by the protobuf-maven-plugin. Using

<plugin>
    <groupId>org.xolstice.maven.plugins</groupId>
    <artifactId>protobuf-maven-plugin</artifactId>
    <configuration>
        ...
        <outputDirectory>
            lite:${project.build.directory}/generated-sources/protobuf/java
        </outputDirectory>
    </configuration>
</plugin>

does not work.

sergei-ivanov commented 5 years ago

Looks like I need to port javaScriptOptions behaviour to compile mojo. Or make it a generic behaviour for all mojos. This way of configuring the output parameters was only supported by a couple of protoc output targets historically, but now seems to be more commonplace.

stuffandthings commented 4 years ago

@hpehl were you able to find a workaround? Finding myself wanting to generate lite variant code with maven as well.

hpehl commented 4 years ago

@stuffandthings Unfortunately no. I'm stuck right now.