I need to use a Jar from a remote repository. I am providing the dependency details in the dependencies section in build.gradle like this -
compile("com.rhuldip.artifactId:com.rhuldip.projectId:1-SNAPSHOT")
But in my remote repository there are 3 files maven-metadata.xml,com.rhuldip.projectId-1-SNAPSHOT.jar and com.rhuldip.projectId-1-SNAPSHOT.pom. com.rhuldip.projectId-1-SNAPSHOT.pom contains multiple dependencies which i dont need in my project.
I just need com.rhuldip.projectId-1-SNAPSHOT.jar in my project. Is there any way i can get only the specified jar and not the pom dependencies?
Your jar, and your project, will not work without the other dependencies.
You need to read the documentation on transitive dependencies.
Updates:
Maven assumes that all jars are thin-jars, and therefore it always reads the accompanying pom to determine what other dependencies it needs to download.
For your case, if you are using a fat-jar, you have two options: