I've been trying to manage my java jar files on Google cloud artifact registry using maven build. I was successful on uploading the jar file to the artifact registry. And when I'm trying to add that jar file in my another project, the maven build is successful, but I'm unable to use that package!!
What could be the possible reason?
PS: I've already included this in my pom.xml
<project>
<distributionManagement>
<snapshotRepository>
<id>artifact-registry</id>
<url>{url}</url>
</snapshotRepository>
<repository>
<id>artifact-registry</id>
<url>{url}</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>artifact-registry</id>
<url>{url}</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<extensions>
<extension>
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.0</version>
</extension>
</extensions>
</build>
</project>
I’ve following these documentations
https://cloud.google.com/artifact-registry/docs/java/store-java
I resolved this error, the main error on loading the dependency because of the jar structure of springboot application.
I followed the following article: https://medium.com/publicis-sapient-france/import-spring-boot-application-as-a-maven-dependency-a25e03e5c3a#:~:text=The%20solution%20that%20we%20found,be%20imported%20from%20other%20projects.&text=Now%2C%20we%20got%20two%20JARs,%2Dapp%2Dto%2Dimport.