0

I have the following build.gradle file:

apply plugin: "java"

version '1.0'

sourceCompatibility = 1.8

sourceSets.main.java.srcDirs = ["src"]

allprojects {
    repositories {
        mavenCentral()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

dependencies{
    compileOnly 'com.github.Recessive:repo:v0.5' 
    implementation 'mysql:mysql-connector-java:8.0.12'
}

jar{
    archiveFileName = "${project.archivesBaseName}.jar"
    from{
        configurations.runtimeClasspath.collect{it.isDirectory() ? it : zipTree(it)}
    }

    from(rootDir){
        include "plugin.json"
    }
}

That isn't working and returning the error

LocalRepo1:main: Could not find com.github.Recessive.repo:v0.5:.

To add salt to the wound, I released a v0.2 three months ago, and this works perfectly fine. Changing the line

compileOnly 'com.github.Recessive:repo:v0.5'

to

compileOnly 'com.github.Recessive:repo:v0.2'

will build with the older version no problem. I've released v0.3 to v0.5 as troubleshooting just to try and get jitpack to work, they are all functionally the same. I tried using the master-SNAPSHOT as well but this stopped working when I made the v0.3 release for unknown reasons.

The only error I will get regardless of the issue is the one stated before, making it basically impossible to know what is going on without significant knowledge of jitpack and gradle, hence the question here.

If anyone has any idea why this error might have suddenly popped up help would be greatly appreciated

EDIT: Also I know jitpack is returning the v0.2 version properly as I checked the link manually. While gradle is just building from the cached version jitpack is also behaving as expected

Recessive
  • 1,780
  • 2
  • 14
  • 37

1 Answers1

0

90% sure this was caused by the git history being too long (ie, over 500mb). To fix this I did the following:

git checkout --orphan <orphan-branch-name>
git commit

git push <remote-name> <orphan-branch-name>

This created an orphan branch with no commit history. Then in the build file I replaced the version with:

dependencies{
    compileOnly "com.github.Recessive:repo:orphan-SNAPSHOT"
}

And it started working. Gradle/Jitpack has a horrendous lack of proper error reporting, as is evident but the most common error message from Jitpack having 10 different answers

Recessive
  • 1,780
  • 2
  • 14
  • 37