title: Unable to find a suitable main class, please add a 'mainClass' property
body: <p>I totally understand this error message meaning, but how to fix it? 
  Intellij doesn't allow me to click on the main application class.</p>
  
  <blockquote>
    <p>org.springframework.boot:spring-boot-maven-plugin:2.1.7.RELEASE:run (default-cli) on project XprojApplication: Unable to find a suitable main class, please add a 'mainClass' property -> [Help 1]</p>
  </blockquote>
  
  <h1>pom.xml</h1>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
          &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
          &lt;parent&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
              &lt;version&gt;2.1.7.RELEASE&lt;/version&gt;
              &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
          &lt;/parent&gt;
          &lt;groupId&gt;dev.house&lt;/groupId&gt;
          &lt;artifactId&gt;xproj&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;name&gt;15house&lt;/name&gt;
  
          &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
          &lt;properties&gt;
              &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;/properties&gt;
  
          &lt;packaging&gt;war&lt;/packaging&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
                  &lt;exclusions&gt;
                      &lt;exclusion&gt;
                          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                          &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
                      &lt;/exclusion&gt;
                  &lt;/exclusions&gt;
  
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
                  &lt;scope&gt;provided&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
                  &lt;artifactId&gt;tomcat-servlet-api&lt;/artifactId&gt;
                  &lt;version&gt;8.0.36&lt;/version&gt;
                  &lt;scope&gt;provided&lt;/scope&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.h2database&lt;/groupId&gt;
                  &lt;artifactId&gt;h2&lt;/artifactId&gt;
                  &lt;scope&gt;runtime&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;mysql&lt;/groupId&gt;
                  &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
                  &lt;scope&gt;runtime&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
                  &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
                  &lt;version&gt;2.9.4&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
                  &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
                  &lt;version&gt;2.9.4&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
                  &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
                  &lt;version&gt;2.9.4&lt;/version&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
  
          &lt;build&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;package&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;single&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                      &lt;configuration&gt;
      &lt;!--                    &lt;archive&gt;--&gt;
      &lt;!--                        &lt;manifest&gt;--&gt;
      &lt;!--                            &lt;addClasspath&gt;true&lt;/addClasspath&gt;--&gt;
      &lt;!--                            &lt;mainClass&gt;dev.house.XprojApplication&lt;/mainClass&gt;--&gt;
      &lt;!--                        &lt;/manifest&gt;--&gt;
      &lt;!--                    &lt;/archive&gt;--&gt;
                          &lt;descriptorRefs&gt;
                              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                          &lt;/descriptorRefs&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
  
              &lt;/plugins&gt;
              &lt;directory&gt;/Users/poc/workspace/tw-real-estate-service-manager/webapps/15house&lt;/directory&gt;
              &lt;finalName&gt;15house&lt;/finalName&gt;
          &lt;/build&gt;
  
      &lt;/project&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yWw3C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yWw3C.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/vUI2v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vUI2v.png" alt="enter image description here"></a></p>