title: Gradle Artifactory publication error
body: <p>I'm new working with Gradle and Artifactory and I used an example that is not working correctly from this <a href="http://www.javacodegeeks.com/2014/08/publish-jar-artifact-using-gradle-to-artifactory.html">example site</a> I have this error message:</p>
  
  <pre><code>Extension of type 'PublishingExtension' does not exist. Currently registered extension types: [DefaultExtraPropert iesExtension, DefaultArtifactPublicationSet_Decorated, ReportingExtension_Decorated, DefaultProjectComponentContai ner_Decorated, DefaultProjectSourceSet_Decorated, DefaultBinaryContainer_Decorated]
  </code></pre>
  
  <p>I have an error in this line:</p>
  
  <pre><code>defaults{
      publications ('mavenJava')
  }
  </code></pre>
  
  <p>Some one could help me with this I have been stuck in this issue for so long.</p>
  
  <p>After reviewing the links as JBaruch recommended and compare with the code I changed the plugin but still the same problem. Maybe I'm confusing something?
  (That is why I will post the whole source code)</p>
  
  <pre><code>buildscript {
      repositories {
          maven {
              url 'http://.../artifactory/libs-release'
              credentials {
                  username = "${artifactory_user}"
                  password = "${artifactory_password}"
              }
              name = "maven-main-cache"
          }
      }
      dependencies {
          classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
      }
  }
  
  apply plugin: 'scala'
  apply plugin: 'maven-publish'
  apply plugin: "com.jfrog.artifactory"
  
  version = '1.0.0-SNAPSHOT'
  group = 'com.buransky'
  
  repositories {
      add buildscript.repositories.getByName("maven-main-cache")
  }
  
  dependencies {
      compile 'org.scala-lang:scala-library:2.11.2'
  }
  
  tasks.withType(ScalaCompile) {
      scalaCompileOptions.useAnt = false
  }
  
  artifactory {
      contextUrl = "${artifactory_contextUrl}"
      publish {
          repository {
              repoKey = 'libs-snapshot-local'
              username = "${artifactory_user}"
              password = "${artifactory_password}"
              maven = true
  
          }
          defaults{
              publications ('mavenJava')
          }
      }
  }
  
  publishing {
      publications {
          mavenJava(MavenPublication) {
              from components.java
          }
      }
  }
  </code></pre>
  
  <p>Thank you very much</p>