[英]Unable to use Maven dependency inside my Spring boot project
I have published my artifact to Maven.我已将我的工件发布到 Maven。 Can be accessed here ->https://oss.sonatype.org/#nexus-search;classname~AccessGateLabs可以在这里访问 ->https://oss.sonatype.org/#nexus-search;classname~AccessGateLabs
Thereafter, I have added the dependency,此后,我添加了依赖项,
<dependency>
<groupId>com.accessgatelabs.oss</groupId>
<artifactId>response-builder</artifactId>
<version>1.0.2</version>
</dependency>
The dependency got added and I can see the jar inside the Maven dependency folder (screenshot attached)添加了依赖项,我可以在 Maven 依赖项文件夹中看到 jar(附截图)
After this, I am unable to import the class from this dependency.在此之后,我无法从此依赖项中导入 class。
Thanks!谢谢!
The problem is that you have deployed an uber-jar containing Sping classes, not your own library with you classes.问题是您已经部署了一个包含 Sping 类的 uber-jar,而不是您自己的类库。 You see in the archive browser when browsing the jar that the root directory is "org/springframework/boot"您在浏览 jar 时在存档浏览器中看到根目录为“org/springframework/boot”
The solution is to not use the Spring plugin for packaging, but the default maven jar packaging plugin.解决方法是不使用 Spring 插件进行打包,而是使用默认的 maven jar 打包插件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.