2

Jitpack builds my project with this logs. As you can see there is an error: "ERROR: No build artifacts found".

What i do wrong?

Here is my 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
}
raury
  • 85
  • 1
  • 7

2 Answers2

12

I got the same issue as you, then I fixed it by following these steps:

  1. Add publish plugin
id 'maven-publish'
  1. Custom publishing
publishing {
    publications {
        mavenJava(MavenPublication) {
            groupId = 'org.gradle.sample'
            artifactId = 'library'
            version = '1.1'

            from components.java
        }
    }
}

You can see the full example here: https://github.com/hukacode/huka-common/blob/main/build.gradle

David
  • 3,971
  • 1
  • 26
  • 65
Huka
  • 380
  • 2
  • 12
0

If it's on Android, do as such: https://github.com/jitpack/jitpack.io/issues/3814#issuecomment-997228875

plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'maven-publish'
}

...
android {
...
}
afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
            }
        }
    }
}
android developer
  • 114,585
  • 152
  • 739
  • 1,270