Jitpack.io: 401 from public repository

Created on 30 Oct 2017  路  8Comments  路  Source: jitpack/jitpack.io

When upgrading my dependencies, it failed with the newer version or ErrorProne.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':caffeine:compileJavaPoetJava'.
> Could not resolve all files for configuration ':caffeine:errorprone'.
   > Could not resolve com.github.stephenc.jcip:jcip-annotations:1.0-1.
     Required by:
         project :caffeine > com.google.errorprone:error_prone_core:2.1.2
      > Could not resolve com.github.stephenc.jcip:jcip-annotations:1.0-1.
         > Could not get resource 'https://jitpack.io/com/github/stephenc/jcip/jcip-annotations/1.0-1/jcip-annotations-1.0-1.pom'.
            > Could not HEAD 'https://jitpack.io/com/github/stephenc/jcip/jcip-annotations/1.0-1/jcip-annotations-1.0-1.pom'. Received status code 401 from server: Unauthorized

The dependency is on Maven Central. However, the unauthorized response causes the build to fail immediately rather than query other repositories.

Most helpful comment

Hi Ben,

Is mavenCentral() above jitpack.io in the repositories section?

JitPack is returning unauthorized because github.com/stephenc/jcip is not accessible. It could mean its not there or it could be a private repository which requires authentication. If we always returned 404 then Gradle would not try to authenticate.
Agree that Gradle should not be stopping on 401.

All 8 comments

In this case, I was able to work around it by using a dependency substitution. I think a 401 is too strong of an error to return and either jitpack needs to uses 404 or request that Gradle not halt on this response.

configurations.all {
  resolutionStrategy.dependencySubstitution {
    substitute module('com.github.stephenc.jcip:jcip-annotations') with module('net.jcip:jcip-annotations:1.0')
  }
}

Hi Ben,

Is mavenCentral() above jitpack.io in the repositories section?

JitPack is returning unauthorized because github.com/stephenc/jcip is not accessible. It could mean its not there or it could be a private repository which requires authentication. If we always returned 404 then Gradle would not try to authenticate.
Agree that Gradle should not be stopping on 401.

His repository does exist and is public,
https://github.com/stephenc/jcip-annotations

jitpack is above Central, but only due to OCD of making the build file lines flow nicely. I can shuffle it down if that's the advice. =)

Okay, that seems to work. Thanks!

@jitpack-io
I am having the same issue. Here is build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.1.0'
        classpath 'io.fabric.tools:gradle:+'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        maven { url "$rootDir/../node_modules/react-native/android" }
        maven { url "https://jitpack.io" }
        jcenter()
    }
}

screen shot 2018-11-18 at 10 04 27 pm

This issue is obviously not solved. I also encounter the same problem using a public repository: https://jitpack.io/#jcornaz/collekt

@jitpack-io: please reopen the issue.

@jcornaz Perhaps you can open a new issue with details of your project? Will have a look

@jitpack-io. It seems to work right now.

I suspect I did a mistake in the coordinate. However if it is the case a 404 would be more meaningful and would help finding the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omrihq picture omrihq  路  6Comments

cekvenich picture cekvenich  路  4Comments

mannodermaus picture mannodermaus  路  3Comments

hypest picture hypest  路  5Comments

ennru picture ennru  路  4Comments