You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/Users/david/.lein/cache/lein-protobuf/protobuf-2.5.0/src/protoc person.proto --java_out=/Users/david/dev/maybe/sample/target/protosrc -I. -I/Users/david/dev/maybe/sample/target/proto -I/Users/david/dev/maybe/sample/resources/proto
ERROR: /Users/david/dev/maybe/sample/target/proto: warning: directory does not exist.
--java_out: person.proto: person.proto: Cannot generate Java output because the file's outer class name, "Person", matches the name of one of the types declared inside it. Please either rename the type or use the java_outer_classname option to specify a different outer class name for the .proto file.
The text was updated successfully, but these errors were encountered:
the protobuf namespace (may or may not be the same as the Java ones, below)
the generated Java package name
the generated Java class name
The .proto file starts with a package declaration, which helps to prevent naming conflicts between different projects. In Java, the package name is used as the Java package unless you have explicitly specified a java_package, as we have here. Even if you do provide a java_package, you should still define a normal package as well to avoid name collisions in the Protocol Buffers name space as well as in non-Java languages.
After the package declaration, you can see two options that are Java-specific: java_package and java_outer_classname. java_package specifies in what Java package name your generated classes should live. If you don't specify this explicitly, it simply matches the package name given by the package declaration, but these names usually aren't appropriate Java package names (since they usually don't start with a domain name). The java_outer_classname option defines the class name which should contain all of the classes in this file. If you don't give a java_outer_classname explicitly, it will be generated by converting the file name to camel case. For example, "my_proto.proto" would, by default, use "MyProto" as the outer class name.
I'm walking through the README example, but I get an error (see below).
I start a sample project with this
project.clj
:I create
resources/proto/person.proto
with these contents:Then I run
lein protobuf
and I get:The text was updated successfully, but these errors were encountered: