Unable to use Maven dependency inside my Spring boot project

Viewed 284

I have published my artifact to Maven. Can be accessed here -> 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) Screenshot of Dependency got added

After this, I am unable to import the class from this dependency.

enter image description here

Thanks!

1 Answers

The problem is that you have deployed an uber-jar containing Sping classes, not your own library with you classes. You see in the archive browser when browsing the jar that the root directory is "org/springframework/boot"

The solution is to not use the Spring plugin for packaging, but the default maven jar packaging plugin.

Related