@@ -147,7 +147,56 @@ dependencies {
147147}
148148```
149149
150- Maven and Gradle will automatically download the SDK and all its dependencies (gRPC, protobuf, etc.).
150+ ** Important** : You must also add the required dependencies manually, as they are not automatically included:
151+
152+ ``` xml
153+ <!-- Add these dependencies in addition to the SDK -->
154+ <dependencies >
155+ <!-- Zerobus SDK -->
156+ <dependency >
157+ <groupId >com.databricks</groupId >
158+ <artifactId >zerobus-ingest-sdk</artifactId >
159+ <version >0.1.0</version >
160+ </dependency >
161+
162+ <!-- Required dependencies -->
163+ <dependency >
164+ <groupId >com.google.protobuf</groupId >
165+ <artifactId >protobuf-java</artifactId >
166+ <version >3.24.0</version >
167+ </dependency >
168+ <dependency >
169+ <groupId >io.grpc</groupId >
170+ <artifactId >grpc-netty-shaded</artifactId >
171+ <version >1.58.0</version >
172+ </dependency >
173+ <dependency >
174+ <groupId >io.grpc</groupId >
175+ <artifactId >grpc-protobuf</artifactId >
176+ <version >1.58.0</version >
177+ </dependency >
178+ <dependency >
179+ <groupId >io.grpc</groupId >
180+ <artifactId >grpc-stub</artifactId >
181+ <version >1.58.0</version >
182+ </dependency >
183+ <dependency >
184+ <groupId >org.slf4j</groupId >
185+ <artifactId >slf4j-api</artifactId >
186+ <version >1.7.36</version >
187+ </dependency >
188+ <dependency >
189+ <groupId >org.slf4j</groupId >
190+ <artifactId >slf4j-simple</artifactId >
191+ <version >1.7.36</version >
192+ </dependency >
193+ <dependency >
194+ <groupId >javax.annotation</groupId >
195+ <artifactId >javax.annotation-api</artifactId >
196+ <version >1.3.2</version >
197+ </dependency >
198+ </dependencies >
199+ ```
151200
152201** Fat JAR (with all dependencies bundled):**
153202
@@ -236,35 +285,15 @@ Create `pom.xml`:
236285 <artifactId >zerobus-ingest-sdk</artifactId >
237286 <version >0.1.0</version >
238287 </dependency >
239- </dependencies >
240288
241- <build >
242- <plugins >
243- <!-- Protobuf compilation -->
244- <plugin >
245- <groupId >org.xolstice.maven.plugins</groupId >
246- <artifactId >protobuf-maven-plugin</artifactId >
247- <version >0.6.1</version >
248- <configuration >
249- <protocArtifact >com.google.protobuf:protoc:3.24.0:exe:${os.detected.classifier}</protocArtifact >
250- </configuration >
251- <executions >
252- <execution >
253- <goals >
254- <goal >compile</goal >
255- </goals >
256- </execution >
257- </executions >
258- </plugin >
259- </plugins >
260- <extensions >
261- <extension >
262- <groupId >kr.motd.maven</groupId >
263- <artifactId >os-maven-plugin</artifactId >
264- <version >1.7.1</version >
265- </extension >
266- </extensions >
267- </build >
289+ <!-- Required dependencies (see above for full list) -->
290+ <dependency >
291+ <groupId >com.google.protobuf</groupId >
292+ <artifactId >protobuf-java</artifactId >
293+ <version >3.24.0</version >
294+ </dependency >
295+ <!-- Add other dependencies from the list above -->
296+ </dependencies >
268297</project >
269298```
270299
@@ -302,6 +331,8 @@ protoc --java_out=src/main/java src/main/proto/record.proto
302331
303332This generates ` src/main/java/com/example/proto/Record.java ` .
304333
334+ ** Note** : Ensure you have ` protoc ` version 24.4 installed. [ Download protoc] ( https://github.com/protocolbuffers/protobuf/releases/tag/v24.4 ) if needed. The generated Java files are compatible with ` protobuf-java ` 3.24.0.
335+
305336### Generate Protocol Buffer Schema from Unity Catalog (Alternative)
306337
307338Instead of manually writing and compiling your protobuf schema, you can automatically generate it from an existing Unity Catalog table schema using the included ` GenerateProto ` tool.
@@ -465,17 +496,21 @@ public class ZerobusClient {
465496** Using Maven:**
466497
467498``` bash
468- # Compile protobuf and Java code
469- mvn compile
499+ # First, compile the proto file to generate Java classes
500+ protoc --java_out=src/main/java src/main/proto/record.proto
470501
471- # Run your application
502+ # Compile and run
503+ mvn compile
472504mvn exec:java -Dexec.mainClass=" com.example.ZerobusClient"
473505```
474506
475- ** Or build and run as JAR:**
507+ ** Or build as standalone JAR:**
476508
477509``` bash
478- # Package into JAR
510+ # Generate proto classes
511+ protoc --java_out=src/main/java src/main/proto/record.proto
512+
513+ # Package into executable JAR (add maven-shade-plugin to pom.xml)
479514mvn package
480515
481516# Run the JAR
@@ -485,6 +520,9 @@ java -jar target/my-zerobus-app-1.0-SNAPSHOT.jar
485520** Using downloaded JAR (without Maven):**
486521
487522``` bash
523+ # Generate proto classes
524+ protoc --java_out=src/main/java src/main/proto/record.proto
525+
488526# Compile
489527javac -cp " lib/*" -d out src/main/java/com/example/ZerobusClient.java src/main/java/com/example/proto/Record.java
490528
0 commit comments