title: Could not transfer artifact pom in gradle maven-publish plugin
body: <p>I use the gradle (2.9) <strong>maven-publish</strong> plugin to publish a file to a private nexus maven repo. The build.gradle file is </p>
  
  <pre><code>apply plugin: 'maven-publish'
  
  publishing {
      repositories {
          maven {
              name "example-maven"
              url "https://..."
              credentials {
                  username mavenUser
                  password mavenPassword
              }
          }
      }
      publications {
          maven(MavenPublication) {
  
              groupId 'com.example.karaf-utils'
              artifactId 'esa-bootstrapper'
              version '1.0.0'
  
              artifact source: "${projectDir}/kar/example.esa.bootstrapper.kar", extension: 'kar'
  
          }
      }
  }
  </code></pre>
  
  <p>The kar file is correctly uploaded and in nexus I can see the expected xml descriptor:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.example.karaf-utils&lt;/groupId&gt;
    &lt;artifactId&gt;esa-bootstrapper&lt;/artifactId&gt;
    &lt;version&gt;1.0.0&lt;/version&gt;
    &lt;type&gt;kar&lt;/type&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>but unfortunately, during the execution of the <code>publish</code> task, I get the following error:</p>
  
  <pre><code>gradle :com.example.karaf.subsys.bootstrap:publish
  :com.example.karaf.subsys.bootstrap:generatePomFileForMavenPublication
  :com.example.karaf.subsys.bootstrap:publishMavenPublicationToexample-mavenRepository
  Upload https://nexus.dev.example.io/nexus/content/repositories/example-maven/com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.kar
  Upload https://nexus.dev.example.io/nexus/content/repositories/example-maven/com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.kar.sha1
  Upload https://nexus.dev.example.io/nexus/content/repositories/example-maven/com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.kar.md5
  Upload https://nexus.dev.example.io/nexus/content/repositories/example-maven/com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.pom
  Could not transfer artifact com.example.karaf-utils:esa-bootstrapper:pom:1.0.0 from/to remote (https://nexus.dev.example.io/nexus/content/repositories/example-maven): Could not write to resource 'com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.pom'
  :com.example.karaf.subsys.bootstrap:publishMavenPublicationToexample-mavenRepository FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':com.example.karaf.subsys.bootstrap:publishMavenPublicationToexample-mavenRepository'.
  &gt; Failed to publish publication 'maven' to repository 'example-maven'
     &gt; Failed to deploy artifacts: Could not transfer artifact com.example.karaf-utils:esa-bootstrapper:pom:1.0.0 from/to remote (https://nexus.dev.example.io/nexus/content/repositories/example-maven): Could not write to resource 'com/example/karaf-utils/esa-bootstrapper/1.0.0/esa-bootstrapper-1.0.0.pom'
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  </code></pre>
  
  <p>How could I fix this error?</p>