'Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile-custom protoc did not exit cleanly

I've been struggling with the following error.

[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile-custom (compile) on project grpc: protoc did not exit cleanly. Review output for more information. -> [Help 1]

I have a parent pom where I have defined plugin under pluginManagement tag. In child pom I am using the plugin defined in parent pom. Here is how my pom file looks like.

Parent pom:

<pluginManagement>
             <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>0.6.1</version>
             </plugin>
</pluginManagement>

Child pom:

    </plugins>
         <plugin>
            <groupId>org.xolstice.maven.plugins</groupId>
            <artifactId>protobuf-maven-plugin</artifactId>
            <configuration>
                    <protocArtifact>
                        com.google.protobuf:protoc:3.14.0:exe:${os.detected.classifier}
                    </protocArtifact>
                    <pluginId>grpc-java</pluginId>
                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:${protoc.version}:exe:${os.detected.classifier}
                    </pluginArtifact>
                    <protocPlugins>
                        <protocPlugin>
                            <id>vertx-grpc-protoc-plugin</id>
                            <groupId>io.vertx</groupId>
                            <artifactId>vertx-grpc-protoc-plugin</artifactId>
                            <version>4.2.3</version>
                            <mainClass>io.vertx.grpc.protoc.plugin.VertxGrpcGenerator</mainClass>
                        </protocPlugin>
                    </protocPlugins>
                </configuration>
                <executions>
                    <execution>
                        <id>compile</id>
                        <configuration>
                            <outputDirectory>${protobuf.output.directory}</outputDirectory>
                            <clearOutputDirectory>false</clearOutputDirectory>
                        </configuration>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                            <goal>test-compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
        </plugin>
    </plugins>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source