如何将包转换为 Maven 依赖项?

How do you convert a package into a Maven dependency?

我的 Spring 启动应用程序无法启动,它给出了这个异常:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'setupIdsClient' defined in com.spinsci.ssodemo.SSODemoApplication: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.cisco.ccbu.common.ids.client.IdSClient]: Factory method 'setupIdsClient' threw exception; nested exception is java.lang.NoClassDefFoundError: com/google/gson/JsonSyntaxException

我想是因为这个 SDK:

https://developer.cisco.com/docs/contact-center-express/#!cisco-identity-service-client-sdk

我不能使用有依赖关系的那个,因为它会抱怨另一个错误 (Caused by: java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;)。我相信打包的依赖项已过时或与 Spring Boot.我想自己用 Maven pom.xml 打包依赖项。

如何指定要使用的工件和组?我在 https://search.maven.org/#search%7Cga%7C1%7Crepository 上搜索 com.google.gson.JsonSyntaxException,但它只给了我 2 个结果 com.jwebmpcom.jwebmp.jre10,这听起来不对。

啊,我必须在前面加上 fc: 才能进行完整的 class 搜索:

https://search.maven.org/search?q=fc:com.google.gson.JsonSyntaxException

它仍然出现了一些有问题的结果,但我找到了正确的结果。