Closed susanYYT closed 1 month ago
There was an upgrade guide from 5 to 6 that explains most of the changes you need but can't seem to find it now
There was an upgrade guide from 5 to 6 that explains most of the changes you need but can't seem to find it now
No, I found the upgrade guide: https://github.com/microsoftgraph/msgraph-sdk-java/blob/main/docs/upgrade-to-v6.md. But it can't solve the problems I meet.
Try removing
From your pom as this is included in microsoft-graph 6.13.0.
The cannot be resolved errors you are getting - are these at runtime or compliation errors? Try building the project and doing a maven clean and install to ensure the libraries are picked up.
I've removed the microsoft-graph-core 3.1.14, but it doesn't work. When I execute mvn clean install, I still failed with error like: ERROR] Failed to execute goal [32morg.eclipse.tycho:tycho-compiler-plugin:1.7.0:compileERROR[m on project [sharepointservice[m: [1;31mCompilation failure[m: Compilation failure: [ERROR] **/MicrosoftGraphService.java:[76] [ERROR] graphClient = new GraphServiceClient(clientSecretCredential, scope); [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] The type com.microsoft.kiota.authentication.AuthenticationProvider cannot be resolved. It is indirectly referenced from required .class files [ERROR] **/MicrosoftGraphService.java:[76] [ERROR] graphClient = new GraphServiceClient(clientSecretCredential, scope); [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] The type com.microsoft.kiota.RequestAdapter cannot be resolved. It is indirectly referenced from required .class files [ERROR] 2 problems (2 errors) [ERROR] -> [1m[Help 1][m
There was an upgrade guide from 5 to 6 that explains most of the changes you need but can't seem to find it now
What's missing from this upgrade guide is a link to any v6 JavaDocs. The javadoc jar on Maven Central is empty, nothing but a META-INF
directory. Ditto for all the other v6 versions I checked. I'm trying to upgrade a v5 app and frustrated by the lack of JavaDocs. In particular, I'm stumbling around trying to find the import
and API for classes like PageIterator
, RequestConfiguration
, etc. If you won't provide JavaDocs, then at least show the import
s in your examples.
My apologies for this experience @susanYYT
As I try to reproduce this, you can add microsoft-kiota-abstractions
as a direct dependency and let me know if this unblocks you.
Thank you for the feedback @johnthad. Created https://github.com/microsoftgraph/msgraph-sdk-java/issues/2078 to track it.
@susanYYT
To get sites by URL:
Site site = graphClient.sites().bySiteId(sitePath).get();
should work with the sitePath being "{hostname}:/{server-relative-path}"
Similarly for Drives:
use graphClient.drives().byDriveId("driveId").items().byDriveItemId("itemPath").get()
with itemPath as root:/{relative path}:
(with trailing colon)
Thanks very much. It works by adding microsoft-kiota-abstractions
Hi,
I'm upgrading microsoft graph from 5.80.0 to 6.13.0. The pom.xml part change:
And here I have several questions.
My code is:
Site site = graphClient.sites().byId(sitePath).buildRequest().get();
In v6, I only find http method in the doc. Could I use:Site site = graphClient.sites().bySiteId(sitePath).get();
DriveItem item = graphClient.sites(site.id).drives(d.id).root().itemWithPath(itemPath).buildRequest().get();
In v6. am I correct:DriveItem item = graphClient.drives().byDriveId(d.getId()).root().withUrl(itemPath).get();
ListCollectionPage.getNextPage()
in v5.While in v6, I try to use PageIterator:
But it shows "The type com.microsoft.kiota.serialization.ParsableFactory cannot be resolved. "
Could you please give me some suggestions?
Best regards, Susan