How to solve Jitpack "ERROR: No build artifacts found"?

How to solve Jitpack "ERROR: No build artifacts found"?

Jitpack 使用这个 logs 构建我的项目。如您所见,出现错误:“错误:未找到构建工件”。

我做错了什么?

这是我的 gradle.build:

plugins {
    id 'java'
    id 'maven-publish'
}

group 'com.github.azzztec'
version '1.0.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}

test {
    useJUnitPlatform()
}

wrapper {
    gradleVersion = "7.0.2"
    distributionType = Wrapper.DistributionType.ALL
}

我遇到了和你一样的问题,然后我按照以下步骤解决了它:

  1. 添加发布插件
id 'maven-publish'
  1. 自定义发布
publishing {
    publications {
        mavenJava(MavenPublication) {
            groupId = 'org.gradle.sample'
            artifactId = 'library'
            version = '1.1'

            from components.java
        }
    }
}

您可以在此处查看完整示例: https://github.com/hukacode/huka-common/blob/main/build.gradle