I want upload artifact to Jfrog artifactory but while uploading getting getting skipped> Task :publish UP-TO-DATE Skipping task ':publish' as it has no actions

we are migrating from maven to Gradle, when we are using maven we are able to upload artifacts to jfrog but once we migrated to Gradle I couldn’t able to upload artifact to Jfrog.

I have created new Gradle repository in jfrog

My build.gradle file

/*
 * This file was generated by the Gradle 'init' task.
 *
 * This project uses @Incubating implementations which are subject to change.
 */
plugins {
    id 'java-library'    
    id 'maven-publish'
    id 'org.springframework.boot' version '3.3.8'
    id 'io.spring.dependency-management' version '1.1.3'
    id "com.jfrog.artifactory" version "5.+"

}

repositories {
     mavenLocal()
        // 
    maven {
        url = uri('https://repo.maven.apache.org/maven2/')
    }
    // maven {
    //     url = uri('http://jfrog.ashrayhome.com.au:8081/artifactory/gradle-local/')
    //     allowInsecureProtocol = true
    // }
}
// artifactory {
//     publish {
//         contextUrl = "http://jfrog.ashrayhome.com.au:8081/artifactory/"
//         repository {
//             repoKey = 'gradle-local'
//             username = "admin"
//             password = "Gft@02020"
//             //maven = true // Ensure Maven-style publishing
//         }
//         defaults {
//             publications('mavenJava')
//             publishArtifacts = true
//         }
//     }
// }
artifactory {
    contextUrl = 'http://jfrog.ashrayhome.com.au:8081/artifactory'
    publish {
        repository {
            repoKey = 'gradle-local'
            username = project.findProperty("artifactory_user")
            password = project.findProperty("artifactory_password")
        }
        defaults {
            publications('mavenJava')
            publishArtifacts = true
        }
    }
}


configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
    agent
}
jar {
    enabled = true
    archiveClassifier.set("") // Removes the '-plain' suffix
}



bootJar {
    enabled = false
}


dependencies {
    implementation 'org.springframework.boot:spring-boot-starter'
    implementation libs.org.hibernate.orm.hibernate.core
    implementation libs.org.springframework.boot.spring.boot.starter.data.jpa
    implementation libs.org.springframework.boot.spring.boot.starter.web
    implementation libs.org.springframework.boot.spring.boot.starter.security
    implementation libs.org.hibernate.validator.hibernate.validator
    implementation libs.com.fasterxml.jackson.core.jackson.databind
    implementation libs.org.hibernate.orm.hibernate.envers
    implementation libs.org.springframework.spring.context
    //implementation libs.org.apache.logging.log4j.log4j.implementation
    implementation libs.org.apache.commons.commons.lang3
    implementation libs.com.opencsv.opencsv
    implementation libs.org.apache.commons.commons.math3
    implementation libs.io.projectreactor.reactor.core
    implementation libs.org.springframework.spring.web
    implementation libs.org.springframework.boot.spring.boot.starter.webflux
    compileOnly libs.org.projectlombok.lombok
    annotationProcessor libs.org.projectlombok.lombok
  //  testImplementation libs.org.springframework.boot.spring.boot.starter.test
}

group = 'com.gf.exception'
version = '4.0.0-SNAPSHOT'
description = 'GF Global Exception'
java.sourceCompatibility = JavaVersion.VERSION_17

publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
            groupId = 'com.gf.exception'
            artifactId = 'gf-exception'
            version = '.0.0'
        }
    }}

Logs:

Resolved plugin [id: 'java-library']
Resolved plugin [id: 'maven-publish']
Resolved plugin [id: 'org.springframework.boot', version: '3.3.8']
Resolved plugin [id: 'io.spring.dependency-management', version: '1.1.3']
Resolved plugin [id: 'com.jfrog.artifactory', version: '5.+']
Applying dependency management to configuration 'annotationProcessor' in project 'gf-exception'
Applying dependency management to configuration 'api' in project 'gf-exception'
Applying dependency management to configuration 'apiElements' in project 'gf-exception'
Applying dependency management to configuration 'archives' in project 'gf-exception'
Applying dependency management to configuration 'bootArchives' in project 'gf-exception'
Applying dependency management to configuration 'compileClasspath' in project 'gf-exception'
Applying dependency management to configuration 'compileOnly' in project 'gf-exception'
Applying dependency management to configuration 'compileOnlyApi' in project 'gf-exception'
Applying dependency management to configuration 'default' in project 'gf-exception'
Applying dependency management to configuration 'developmentOnly' in project 'gf-exception'
Applying dependency management to configuration 'implementation' in project 'gf-exception'
Applying dependency management to configuration 'mainSourceElements' in project 'gf-exception'
Applying dependency management to configuration 'productionRuntimeClasspath' in project 'gf-exception'      
Applying dependency management to configuration 'runtimeClasspath' in project 'gf-exception'
Applying dependency management to configuration 'runtimeElements' in project 'gf-exception'
Applying dependency management to configuration 'runtimeOnly' in project 'gf-exception'
Applying dependency management to configuration 'testAndDevelopmentOnly' in project 'gf-exception'
Applying dependency management to configuration 'testAnnotationProcessor' in project 'gf-exception'
Applying dependency management to configuration 'testCompileClasspath' in project 'gf-exception'
Applying dependency management to configuration 'testCompileOnly' in project 'gf-exception'
Applying dependency management to configuration 'testImplementation' in project 'gf-exception'
Applying dependency management to configuration 'testResultsElementsForTest' in project 'gf-exception'      
Applying dependency management to configuration 'testRuntimeClasspath' in project 'gf-exception'
Applying dependency management to configuration 'testRuntimeOnly' in project 'gf-exception'
Applying dependency management to configuration 'agent' in project 'gf-exception'
All projects evaluated.
Task name matched 'publish'
Selected primary task 'publish' from project :
Tasks to be executed: [task ':publish']
Tasks that were excluded: []
Resolve mutations for :publish (Thread[Execution worker,5,main]) started.
:publish (Thread[Execution worker,5,main]) started.

> Task :publish UP-TO-DATE
Skipping task ':publish' as it has no actions.

BUILD SUCCESSFUL in 10s
Watched directory hierarchies: [ ]

The “publish” task is just a lifecycle task.
Its role is to depend on other tasks.
It has no actions to execute, so it is skipped, that is normal.
You do not have any repositories configured where to publish to for the maven-publish plugin from wich that publish task is, so there is no work to do.
If you want to use the Artifactory plugin, you probably have to use some other task or wire it to publish manually. :man_shrugging:

How you correctly use the Artifactory plugin, you should probably ask its maintainer.
But as far as I know from other users of that plugin, most of them in the end got sane and stepped away from using that plugin quickly as it seems to be not good and also being unnecesseary as far as I know.

Besides that, you should not use the Spring dependency management plugin. It is a relict from times when Gradle did not have built-in BOM support, by now does more harm than good, and even its maintainer recommends not to use it anymore nowadays, but instead the built-in BOM support using platform(...).

And a personal recommendation, you should switch to Kotlin DSL. By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.

@Vampire

I am new to gradle just let me how how to upload jar file into jfrog,

can you provide that configuration here, i tryed a lot but i can’t able to do it

my artifact will be genarated in build\libs\gf-exception-4.0.0-SNAPSHOT.jar

please help me fix this configuarion

I have no idea, I use neither Jfrog, nor Artifactory and I’m very happy about that fact.

If it behaves like a normal Maven repository, you probably just remove the artifactory plugin and add a publishing repository to your publishing block.

Besides that, you should in almost no case set group, artifact, and version on a publication manually, that has great drawbacks. Instead make sure the project is named like the artifact id should be and group and version are set accordingly on the project, for example by having them in gradle.properties.

@Vampire

I am using jfrog Artifactory