Skip to content

Support for protobuf 4 #158

Closed
Closed
@breun

Description

@breun

I noticed that Spring Initializr sets protoc.version to 3.25.6, while 4.30.2 is the current latest version.

I tried setting protoc.version to 4.30.2 in a demo project, but that results in various compilation errors for the generated source code:

package com.google.protobuf.RuntimeVersion does not exist
cannot find symbol
  symbol:   class RuntimeVersion
  location: package com.google.protobuf
cannot find symbol
  symbol:   method isStringEmpty(java.lang.Object)
  location: class com.google.protobuf.GeneratedMessage
method parseUnknownField in class com.google.protobuf.GeneratedMessage.Builder<BuilderType> cannot be applied to given types;
  required: com.google.protobuf.CodedInputStream,com.google.protobuf.UnknownFieldSet.Builder,com.google.protobuf.ExtensionRegistryLite,int
  found:    com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int
  reason: actual and formal argument lists differ in length
cannot find symbol
  symbol:   method resolveAllFeaturesImmutable()
  location: variable descriptor of type com.google.protobuf.Descriptors.FileDescriptor

Is the the default setup using protoc 3 due to a limitation of the protobuf-maven-plugin that is used?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions