I use dgrah4j in maven:
<dependency>
<groupId>io.dgraph</groupId>
<artifactId>dgraph4j</artifactId>
<version>1.5.0</version>
</dependency>
However, a error raises while I tried to do a mvn compile
and the error messages are mainly like this:
cannot access com.google.protobuf.GeneratedMessageV3
class file for com.google.protobuf.GeneratedMessageV3 not found
Seems like the compiler cannot find this class file GeneratedMessageV3 which should be in this library:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.*.*</version>
</dependency>
After diving into the dependency tree, I found that this library: grpc-protobuf
which is depended by dgraph4j has explicitly exclude the library: protobuf-java
:
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-common-protos</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>protobuf-java</artifactId>
<groupId>com.google.protobuf</groupId>
</exclusion>
// the other exclusions
....
</exclusions>
</dependency>
Therefore, is it necessary for dgraph4j to explicitly depends on the 3.*.* version of protobuf-java library?
Otherwise, the users(like me) of dgraph4j have to depend on the library above in our project explicitly and seems like a little bit weird.