-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Bug] Build fails with validate.proto
#70
Comments
validate.proto
validate.proto
I was able to reproduce this as well, and it turned out to be a missing ProtoBuf dependency and additional configuration for the mentioned Maven plugin, After some digging the error was due to the fact that required context in <dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency> Additionally, the Maven plugin configuration needs to add explicit imports for <plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<includeMavenTypes>direct</includeMavenTypes>
<includeStdTypes>true</includeStdTypes>
<protocVersion>${protobuf.version}</protocVersion>
<inputDirectories>
<inputDirectory>src/main/protobuf</inputDirectory>
</inputDirectories>
<includeDirectories>
<includeDirectory>src/main/protobuf</includeDirectory>
<includeDirectory>src/main/protobuf/protobuf/third_party</includeDirectory>
</includeDirectories>
<outputTargets>
<outputTarget>
<type>java</type>
<addSources>main</addSources>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
</outputTarget>
</outputTargets>
</configuration>
</execution>
</executions>
</plugin> This was confirmed with |
Description
I am trying to use proto validate files in my Java project by adding/importing them via
protoc-jar-maven-plugin
plugin with protobuf version of3.24.4
. However, the build fails when gettin to compilingvalidate.proto
with the below error:Steps to Reproduce
expression.proto
,validate.proto
andprivate.proto
under proto files.pom.xml
file and addprotoc-jar-maven-plugin
plugin with proper input and include directories to import above files.mvn clean package
Expected Behavior
Build passes by compiling above 3 files successfully.
Actual Behavior
Build fails with the error described in the "Description" section above.
Environment
The text was updated successfully, but these errors were encountered: