jfrog / artifactory-gradle-plugin

JFrog Gradle plugin for Build Info extraction and Artifactory publishing.
Apache License 2.0
21 stars 15 forks source link

'ArtifactoryTask' property 'artifactSpecs' doesn't have a configured value #61

Open balachandarg-tw opened 1 year ago

balachandarg-tw commented 1 year ago

How can we help?

I recently upgraded my gradle version from 6.5 to 8.1.1 , while running artifactoryPublish command getting the issue as,

A problem was found with the configuration of task ':artifactoryPublish' (type 'ArtifactoryTask').

It was working fine in gradle 6.5 with jfrog version 4.32.0. I tried updating the jfrog version to 5.1.1, even after that issue persists.

Q1. Where do I need to specify artifactSpecs value? any example would help me to understand better. Q2. How can I make it optional ?

JDK version 17 Compile SDK version 33

yahavi commented 11 months ago

@balachandarg-tw Thanks for using the Gradle Artifactory plugin. Do you have somewhere 'artifactSpecs' configured? Would you be able to provide steps to reproduce?

PatrickVvB commented 6 months ago

@balachandarg-tw Did you solve this problem?

@yahavi I have the same problem in gradle 8.5 and jfrog plugin 5.2.0.

I add artifactory-block in top-level build.gradle.kts

buildscript {
    dependencies {
        classpath("org.jfrog.buildinfo:build-info-extractor-gradle:5.2.0")
    }
}

plugins {
    id("com.jfrog.artifactory") version "5.2.0" apply true
}

artifactory {
    setContextUrl("https://artifactory.url")
    publish {
        contextUrl = "https://artifactory. url"
        repository {
            username = "username"
            password = "password"
        }
        defaults {
            setPublishArtifacts(true)
            setPublishIvy(false)
        }
    }
}

And configure publish build.gradle.kts in feature module

plugins {
    `maven-publish`
    id("com.jfrog.artifactory")
}

configure<PublishingExtension> {
    val publication = maybeCreatePublication()
    publication.groupId = group.toString()
    publication.artifactId = name
    publication.version = version.toString()
    tasks.withType(Jar::class) {
        manifest.attributes["Implementation-Version"] = publication.version
    }

    tasks.withType<ArtifactoryTask>().configureEach {
        publications(publication.artifacts)
    }
}