zipkin icon indicating copy to clipboard operation
zipkin copied to clipboard

Java: the zipkin2.proto3 package does not exist

Open qinwei12345678 opened this issue 3 years ago • 4 comments

Describe the Bug

Build Zipkin version V. 2.23.16 (2022-2-24 Latest) with IDEA Environment

Copy steps

(1)Load project (2)compile info: Java: the zipkin2.proto3 package does not exist

Expected Behaviour

add zipkin2.proto3

qinwei12345678 avatar Feb 24 '22 06:02 qinwei12345678

I get the same problem, the whole rest of the project builds ok but there's a few missing imports under zipkin2.proto3

rswst8 avatar May 18 '22 02:05 rswst8

How solve it? Thank you~!

Layfolk-zcy avatar Jun 02 '22 07:06 Layfolk-zcy

Please, is it possible to get any comment on this? I would like to contribute something to Zipkin, but cannot build it in Intellij. @jcchavezs

vcvitaly avatar Dec 16 '22 20:12 vcvitaly

Running ./mvnw --batch-mode -DskipTests --also-make clean install from the root of the project generates those missing classes in zipkin-server module, I haven't yet figured out how to generate them for the "benchmarks" module.

vcvitaly avatar Dec 16 '22 20:12 vcvitaly

this project doesn't package generated proto code for external use. We have SpanBytesEncoder.PROTO3 which does the same thing, and has no deps.

zipkin-proto3 is only used in our tests. we don't want to publish generated code for protos as they tend to drift across grpc versions. We use square wire, not protoc for tests.

If you want to use google protoc, you probably want to extract zipkin-proto3, from the https://github.com/openzipkin/zipkin-api project like this. Then you can use the normal protoc generation process.

    <dependency>
      <groupId>io.zipkin.proto3</groupId>
      <artifactId>zipkin-proto3</artifactId>
      <version>${zipkin-proto3.version}</version>
      <scope>provided</scope>
    </dependency>

--snip--
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven-dependency-plugin.version}</version>
          <executions>
            <!-- wire-maven-plugin cannot get proto definitions from dependencies: this will -->
            <execution>
              <id>unpack-proto</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>unpack-dependencies</goal>
              </goals>
              <configuration>
                <includeArtifactIds>zipkin-proto3</includeArtifactIds>
                <includes>**/*.proto</includes>
                <outputDirectory>${unpack-proto.directory}</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>

codefromthecrypt avatar Apr 16 '24 07:04 codefromthecrypt