title: Error when building an app with Gradle - No signature of method: build_49q3y83g7hdxe5s51k5187z33.publishing()
body: <p>I'm following a tutorial on publishing artifacts to Nexus and a simple Java app is used as an example. A Gradle file is provided and meant to be changed. In the end, it looks like this:</p>
  <pre><code>plugins {
      id 'java'
      id 'org.springframework.boot' version '2.2.2.RELEASE'
      id 'io.spring.dependency-management' version '1.0.8.RELEASE'
  }
  
  group 'com.example'
  version '1.0-SNAPSHOT'
  
  sourceCompatibility = 1.8
  
  apply plugin: 'maven-publish'
  
  publishing {
      publications {
          maven(MavenPublication) {
              artifacts(&quot;build/libs/my-app-$version&quot;+&quot;.jar&quot;) {
                  extension = 'jar'
              }
          }   
      }
  
      repositories {
          maven {
              name'nexus'
              url &quot;http://someip:someport/repository/maven-snapshots/&quot;
              credentials {
                  username project.repoUser
                  password project.repoPassword
              }
          }
      }
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation 'org.springframework.boot:spring-boot-starter-web'
      implementation group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: '5.2'
      testImplementation group: 'junit', name: 'junit', version: '4.12'
  }
  </code></pre>
  <p>I when I use the command <code>./gradle build</code> I get the following error:</p>
  <pre><code>FAILURE: Build failed with an exception.
  
  * Where:
  Build file '/Users/matteo/Desktop/devops_bootcamp/java-app/build.gradle' line: 14
  
  * What went wrong:
  A problem occurred evaluating root project 'my-app'.
  &gt; No signature of method: build_49q3y83g7hdxe5s51k5187z33.publishing() is applicable for argument types: (build_49q3y83g7hdxe5s51k5187z33$_run_closure1) values: [build_49q3y83g7hdxe5s51k5187z33$_run_closure1@79692f52]
  </code></pre>
  <p>Gradle version: Gradle 7.4.2</p>
  <p>What am I doing wrong?</p>