title: Trying to upload a zip file via gradle to local artifactory
body: <p>I am trying to get familiar with artifactory in combination with gradle. I am having a testproject which basically only contains a zip file (which is to be uploaded to a local artifactory running in docker) and the gradlefiles for the wrapper + build.gradle file.</p>
  <p>My build.gradle file looks like this:</p>
  <pre><code>plugins {
    id &quot;com.jfrog.artifactory&quot; version &quot;4.16.0&quot;
    id 'maven-publish'
    id 'java'
  }
  
  repositories {
      maven { url 'http://localhost:8081/artifactory'}
  }
  
  configurations {
      generic {
          description = 'generic'
      }
      published
  }
  
  artifactory {
      contextUrl = &quot;http://localhost:8081/artifactory&quot;   //The base Artifactory URL if not overridden by the publisher/resolver
      publish {
          repository {
              repoKey = 'gradle-dev-local'
              username = &quot;${local_user}&quot;
              password = &quot;${local_pw}&quot;
              maven = true
              
          }
          defaults {
              publishArtifacts = true
              properties = ['qa.level': 'basic', 'dev.team' : 'core']
              publications('MyZip')
          }
      }
      resolve {
          repository {
              repoKey = 'gradle-dev'
              username = &quot;${local_user}&quot;
              password = &quot;${local_pw}&quot;
              maven = true
              
          }
      }
  }
  publishing {
      publications{
          MyZip(MavenPublication) {
              artifact(file(&quot;jetty.zip&quot;)){
                  extension &quot;zip&quot;
              }
          }
      }
  }
  
  artifactoryPublish {
      publications('MyZip')
  }
  </code></pre>
  <p>When I execute</p>
  <pre><code>./gradlew artifactoryPublish
  </code></pre>
  <p>It says &quot;Build successful&quot; but only uploads the build info to artifactory, NOT the zip file I want it to upload. I googled and looked the following things:</p>
  <p><a href="https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html" rel="nofollow noreferrer">https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html</a></p>
  <p>roma77 in this post had the exact same problem but fixed it, didnt work for me tho:
  <a href="https://discuss.gradle.org/t/publish-zip-artifact/5792/2" rel="nofollow noreferrer">https://discuss.gradle.org/t/publish-zip-artifact/5792/2</a></p>
  <p>Also I tried to follow this example <a href="https://github.com/jfrog/project-examples/blob/master/gradle-examples/gradle-android-example/build.gradle" rel="nofollow noreferrer">https://github.com/jfrog/project-examples/blob/master/gradle-examples/gradle-android-example/build.gradle</a>
  but that also didnt work.</p>
  <p>When I run</p>
  <pre><code>./gradlew artifactoryPublish --info
  </code></pre>
  <p>It says</p>
  <pre><code>Task ':artifactoryPublish' is not up-to-date because:
    Task has not declared any outputs despite executing actions.
  </code></pre>
  <p>Well thats the point I ask you guys because I am pretty much stuck^^ Any help is appreciated.</p>
  <hr />
  <p>Edit 1:
  So after @afterburner suggested a solution I tried it with this build.gradle:</p>
  <pre><code>plugins {
    id &quot;com.jfrog.artifactory&quot; version &quot;4.16.0&quot;
    id 'maven-publish'
    id 'java'
  }
  
  
  repositories {
      maven { url 'http://localhost:8081/artifactory'}
  }
  
  configurations {
      generic {
          description = 'generic'
      }
      published
  }
  
  artifactory {
      contextUrl = &quot;http://localhost:8081/artifactory&quot;   //The base Artifactory URL if not overridden by the publisher/resolver
      publish {
          repository {
              repoKey = 'gradle-dev-local'
              username = &quot;${local_user}&quot;
              password = &quot;${local_pw}&quot;
              maven = true
              
          }
          defaults {
              publishArtifacts = true
              publications('myzip')
          }
      }
      resolve {
          repository {
              repoKey = 'gradle-dev-local'
              username = &quot;${local_user}&quot;
              password = &quot;${local_pw}&quot;
              maven = true
              
          }
      }
  }
  
  task makeZip(type: Zip) {
      from fileTree(dir: 'jetty')
      include '**/*'
      archiveName &quot;jetty.zip&quot;
      destinationDir file(&quot;$buildDir/libs/&quot;)
      description &quot;Assemble archive $archiveName into ${relativePath(destinationDir)}&quot;
  }
  
  publishing {
      publications{
          myzip(MavenPublication) {
              artifact makeZip
          }
      }
  }
  
  artifactoryPublish {
      publications('myzip')
  }
  </code></pre>
  <p>in the following I added a buildscript which looked like this:</p>
  <pre><code>buildscript {
      repositories {
          maven {
              url 'http://localhost:8081/artifactory/plugins-release'
              credentials {
                  username = &quot;${local_user}&quot;
                  password = &quot;${local_pw}&quot;
              }
              name = &quot;local&quot;
          }
      }
      dependencies {
          classpath &quot;org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1&quot;
      }
  }
  </code></pre>
  <p>Found <a href="http://buransky.com/scala/publish-jar-artifact-using-gradle-to-artifactory/" rel="nofollow noreferrer">here</a>. It worked ONCE and didn't work anymore after that. Also it uploaded the zip file under gradle/unspecified. Note's to be taken that I would describe my Gradle skills as fairly limited. I think I might be missing some basic configuration for gradle to say what to do.</p>
  <p>Log:</p>
  <pre><code>&gt; Task :artifactoryDeploys an incubating feature.
  Deploying build descriptor to: http://localhost:8081/artifactory/api/build
  Build successfully deployed. Browse it in Artifactory under http://localhost:8081/artifactory/webapp/builds/gradle/1593782379748
  
  Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
  Use '--warning-mode all' to show the individual deprecation warnings.
  See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
  
  BUILD SUCCESSFUL in 2s
  5 actionable tasks: 4 executed, 1 up-to-date
  </code></pre>