I have a modular jersey based microservice running on JDK 11. It deploys fine to Google App Engine. The code can be downloaded here (or clone the main project and switch to the 3.1 tag): https://github.com/Leejjon/SimpleJerseyService/releases/tag/3.1
Now I want to add access to the Google Cloud Datastore API (which worked on my previous non modular Java 8 project). So I add the maven dependency:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore</artifactId>
<version>1.80.0</version>
</dependency>
And I add requires google.cloud.datastore;
to my module-info.java.
A mvn clean install
runs fine but when I run it via mvn exec:exec
or java -p simple-service-1.0-SNAPSHOT.jar;appengine-staging/ -m myModule/com.example.Main localhost
I get:
Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules grpc.context and grpc.api export package io.grpc to module org.apache.httpcomponents.httpclient
Is there anything I can do in my module-info.java to fix this problem?
After reading posts such as: https://blog.codefx.org/java/java-9-migration-guide/#Split-Packages https://blog.codefx.org/java/jsr-305-java-9/#Modular-Project Modules A and B export package some.package to module C in Java 9
I'm suspecting this google-cloud-datastore library just isn't ready for the Java Module System. I will post an issue on the Google Cloud Client API github refering to this stackoverflow post.