I deployed a Maven project in a private gitlab and after couple of versions deployed, the pom.xml cannot recognize the new dependency, and maven returns that the dependency with that specific version is missing from gitlab package, even if it’s there. I deleted some artifacts from there and the pom.xml is still seeing them, so I am assuming there is a de-sync between the gitlab remote and intellij, but still the maven can’t retrieve latest artifacts from the package registry from gitlab.
My pom.xml looks something like this:
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://my.gitlab.company/api/v4/projects/my-project-id/package/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>https://my.gitlab.company/api/v4/projects/my-project-id/package/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>https://my.gitlab.company/api/v4/projects/my-project-id/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>myartifact</artifactId>
<version>0.0.1-SNAPSHOT</version> <-- this version works
</dependency>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>myartifact</artifactId>
<version>0.0.4-SNAPSHOT</version> <-- this version is not found in gitlab even though it is deployed and I can see it in package registry
</dependency>
</dependencies>
Any tips? Thanks