title: Gradle MavenPublication: "Task has not declared any outputs despite executing actions"
body: <p>I want to publish a zip archive to a remote maven repository. The task <code>zipSources</code> packs a sample file into a zip archive. The publication <code>myPubliction</code> publishes to <code>mavenLocal</code> and to the remote maven repository.</p>
  
  <p>The publication works - I can see the packages uploaded to the remote repository. But the build still fails with</p>
  
  <pre><code>&gt; Task :publishMyPublicationPublicationToMavenRepository FAILED
  Task ':publishMyPublicationPublicationToMavenRepository' is not up-to-date because:
    Task has not declared any outputs despite executing actions.
  Publishing to repository 'maven' (null)
  
  FAILURE: Build failed with an exception.
  </code></pre>
  
  <p>What am I missing? How do I declare outputs for the publishing action? Or is there another cause?</p>
  
  <p>Here is my <code>build.gradle</code>:</p>
  
  <pre><code>plugins {
      id "maven-publish"
  }
  
  group = 'com.example.test'
  version = '0.0.1-SNAPSHOT'
  
  task zipSources(type: Zip, group: "Archive", description: "Archives source in a zip file") {
      from ("src") {
          include "myfile.txt"
      }
      into "dest"
      baseName = "helloworld-demo"
      destinationDir = file("zips")
  }
  
  publishing {
      publications {
          myPublication(MavenPublication) {
              artifactId = 'my-library'
              artifact zipSources
              pom {
                  name = 'My Library'
                  description = 'A concise description of my library'
              }
          }
      }
      repositories {
          maven {
              mavenLocal()
          }
          maven {
              url "http://nexus.local/content/repositories/snapshots"
              credentials {
                  username = 'admin'
                  password = 'admin'
              }
          }
      }
  }
  </code></pre>