Publishing artifact from Copy task
<p>my gradle build copy files. I want to use the output of copy task as input for maven artifact publishing</p>

<p>example : </p>

<pre><code>task example(type: Copy) {
    from "build.gradle" // use as example
    into "build/distributions"
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact example
        }
    }
}
</code></pre>

<p>but gradle doesn't like it : </p>

<pre><code> * What went wrong:
 A problem occurred configuring project ':myproject'.
 &gt; Exception thrown while executing model rule: PublishingPlugin.Rules#publishing(ExtensionContainer)
     &gt; Cannot convert the provided notation to an object of type MavenArtifact: task ':myproject:example'.
       The following types/formats are supported:
       - Instances of MavenArtifact.
       - Instances of AbstractArchiveTask, for example jar.
       - Instances of PublishArtifact
       - Maps containing a 'source' entry, for example [source: '/path/to/file', extension: 'zip'].
       - Anything that can be converted to a file, as per Project.file()
</code></pre>

<p>Why ? </p>

<p>As I understand, the outputs from the task example should be setted by the Copy task. I assume it can be converted to some files. So it should be used as input of the publishing task, as files. But the error message tell me I'm wrong.</p>

<p>How can I fix it ? </p>

<p>Thanks</p>