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

No proto files to compile. #32

Closed magick93 closed 7 years ago

magick93 commented 7 years ago

Im specifying an absolute path to my proto files

<plugins>
    <plugin>
      <groupId>org.xolstice.maven.plugins</groupId>
      <artifactId>protobuf-maven-plugin</artifactId>
      <version>0.5.0</version>
      <configuration>
      <protoSourceRoot>/home/anton/git/myproject/generated/src/main/proto3/</protoSourceRoot>
        <protocArtifact>com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier}</protocArtifact>
        <pluginId>grpc-java</pluginId>
        <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.4.0:exe:${os.detected.classifier}</pluginArtifact>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>compile</goal>
            <goal>compile-custom</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>

When there is an error in the proto files, the protofub-maven-plugin will identify this, eg,

[ERROR] /home/anton/git/myproject/generated/src/main/proto3/myproject/enums/ConfirmModes.proto [0:0]: myproject/enums/FeederModes.proto:3:1: Expected ";".

But, when this syntax error in the proto file is fixed, and I run again, I get:

No proto files to compile.

magick93 commented 7 years ago

Ah, I was saving proto files as .proto3.

Changing file extension to .proto fixed it.

NathanPelli commented 5 years ago

thank you very much,this answer solve the problem perfectly after a long time of searching.

nikoo28 commented 4 years ago

thank you very much for this solution