简体   繁体   English

jitpack 找不到 github repo 的新版本,但可以找到旧版本

[英]jitpack not finding new versions of github repo but can find old ones

I have the following build.gradle file:我有以下build.gradle文件:

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.为了在伤口上撒盐,我在三个月前发布了v0.2 ,而且效果非常好。 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.我已经发布了v0.3v0.5作为故障排除只是为了尝试让 jitpack 工作,它们在功能上都是相同的。 I tried using the master-SNAPSHOT as well but this stopped working when I made the v0.3 release for unknown reasons.我也尝试过使用master-SNAPSHOT ,但是当我出于未知原因发布v0.3时,它停止了工作。

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.无论问题如何,我都会得到的唯一错误是前面提到的错误,如果不了解 jitpack 和 gradle,基本上不可能知道发生了什么,因此这里的问题。

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.编辑:我也知道 jitpack 正在正确返回v0.2版本,因为我手动检查了链接。 While gradle is just building from the cached version jitpack is also behaving as expected虽然 gradle 只是从缓存版本构建,但 jitpack 的行为也符合预期

90% sure this was caused by the git history being too long (ie, over 500mb). 90% 确定这是由 git 历史记录太长(即超过 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 Gradle/Jitpack 严重缺乏正确的错误报告,这是显而易见的,但Jitpack 最常见的错误消息10 个不同的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM