Import org.nuxeo.client.api cannot be resolved
Hi, I try to create a java client nuxeo, I followed this tutorial https://doc.nuxeo.com/nxdoc/java-client/, but i can't import “org.nuxeo.client.api”. it fails with an error : the import org.nuxeo.client.api cannot be resolved. Does anyone have any idea of this error?
Thank you, Amel.
Hi,
Indeed, it's a mistake in our documentation. I will update it.
There's no more api
in package declaration, see https://doc.nuxeo.com/nxdoc/java-client/#operation-api , the correct package name for NuxeoClient
is org.nuxeo.client.NuxeoClient
.
static String url = "http://localhost:8080/nuxeo";
public static void main(String[] args) {
NuxeoClient nuxeoClient = new NuxeoClient.Builder()
.url(url)
.authentication("Administrator", "Administrator")
.connect();
// Fetch the root document
Document root = nuxeoClient.repository().fetchDocumentRoot();
Is there another missing import ? Thank you for your reply
Next time don't hesitate to give your stack trace, generally ~10-15 lines are enough. Here it seems you don't depend on Retrofit
version required by nuxeo-java-client
. The client requires retrofit 2.3.0
. Do you need retrofit in your application ? if not you can remove it from your pom and leveragae transitive dependency with maven.