chonton / exists-maven-plugin

Check if artifact exists in remote maven repository
Apache License 2.0
47 stars 18 forks source link

Incorrectly identifies remote artifact as not existing when in fact it does exist #16

Closed MaiaTechnology closed 3 years ago

MaiaTechnology commented 5 years ago

I have run mvn exists to check if a remote artifact exists and when I click on the URL that is written to stdout by your plugin I can download that artifact using my browser but for some odd reason your plugin thinks the artifact does not exist. Why is that?

[DEBUG] Configuring mojo org.honton.chas:exists-maven-plugin:0.1.0:remote from plugin realm ClassRealm[plugin>org.honton.chas:exists-maven-plugin:0.1.0, parent: sun.misc.Launcher$AppClassLoader@6d6f6e28] [DEBUG] Configuring mojo 'org.honton.chas:exists-maven-plugin:0.1.0:remote' with basic configurator --> [DEBUG] (f) artifact = platform-auth-bdd-1.1.0.jar [DEBUG] (f) cmpChecksum = false [DEBUG] (f) failIfExists = true [DEBUG] (f) failIfNotExists = false [DEBUG] (f) failIfNotMatch = true [DEBUG] (f) mavenProject = MavenProject: au.com.maiatechnology:platform-auth-bdd:1.1.0 @ /Volumes/Maia/git/platform-auth-ui/bdd/pom.xml [DEBUG] (f) project = au.com.maiatechnology:platform-auth-bdd:1.1.0 [DEBUG] (f) property = maven.deploy.skip [DEBUG] (f) repository = https:// [DEBUG] (f) serverId = gitlab-maven [DEBUG] (f) session = org.apache.maven.execution.MavenSession@64bc21ac [DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter@5d25e6bb [DEBUG] (f) skip = false [DEBUG] (f) skipIfSnapshot = true [DEBUG] (f) snapshotRepository = [DEBUG] (f) snapshotServerId = gitlab-maven [DEBUG] (f) userProperty = false [DEBUG] -- end configuration -- [DEBUG] Checking for artifact at [INFO] au.com.maiatechnology:platform-auth-bdd:1.1.0 does not exist

MaiaTechnology commented 5 years ago

I think I understand what the issue is...your plugin is not able to use the gitlab token to authenticate. When a user is not authenticated then a 404 is returned and so your plugin thinks the artifact does not exist remotely. Anyway to resolve that?

chonton commented 5 years ago
  1. Are you able to push to the repository with the current settings.xml?
  2. Did you add your personal access token to your settings.xml as documented in Authenticating with a personal access token?
MaiaTechnology commented 5 years ago

Thanks Chas for your quick response.

I already run: mvn deploy using the gitlab CI Job Token method and that works fine. I can see my artifacts inside gitlab's mvn repo. I assumed your mvn plugin would be able to leverage the same authentication mechanism but I'm guessing not? Is it possible to get any debug info on what your plugin is attempting to do in terms of authentication that might un-mask the underlying issue? Or how can I debug your plugin? I looked at your source code and it looks ok at first glance. I'm guessing the issue is somewhere inside the Wagon API code???

jeffque commented 5 years ago

Same issue here, but with a intranet Artifactory. I have tweaked the version of my project to match with one already present at artifactory and the plugin returned "does not exist".

AFAIK I should be able to push to my Artifactory with current settings.xml, shall test this now

jeffque commented 5 years ago

Oops, sorry...

Recently I've changed my groupId and had not realized it until mvn deploy worked fine. And after that it recognized that the artifact was deployed correctly

ToppScorer commented 3 years ago

Hi,

I'm having exactly the same problem with GitLab.

  1. Are you able to push to the repository with the current settings.xml?

Yes

  1. Did you add your personal access token to your settings.xml as documented in Authenticating with a personal access token?

Yes

Why was this ticket closed?

chonton commented 3 years ago

Probably same as #27