title: Jar built from Gradle multi-module project with Spring Boot doesn't work
body: <p>I created spring-boot gradle multi-module project which consisted of 3 modules: controller, service, repository. Main file was situated in Controller-module and named MySpringBootApplication.</p>
  <p>I could build this project (using gradle build) and could get jar-file. But after starting this jar in command line I took the next error:</p>
  <pre><code>Error: Could not find or load main class com.epam.esm.config.MySpringBootApplication Caused by: java.lang.ClassNotFoundException: com.epam.esm.config.MySpringBootApplication.
  </code></pre>
  <p>To fix this bug I added <code>Main-Class</code> attributte to <em>MANIFEST.MF</em> file in main <code>build.gradle</code> but this action didn't help. So could anybody help?</p>
  <p>MAIN BUILD.GRADLE FILE</p>
  <pre><code>        plugins {
              id 'java'
              id 'io.spring.dependency-management' version '1.0.11.RELEASE'
              id 'org.springframework.boot' version '2.4.3'
              id 'application'
          }
          
          group = 'com.myproject'
          version = 'snapshot-1.0.0'
          
          repositories {
              mavenCentral()
          }
          
          bootJar {
              enabled = false
          }
          
          jar {
              enabled = true
              manifest {
                  attributes(
                          &quot;Main-Class&quot;: &quot;com.myproject.config.MySpringBootApplication&quot;)
              }
          }
         
       dependencies {
              implementation 'org.springframework.boot:spring-boot-starter'
              implementation group: 'org.springframework.boot', name: 'spring-boot-starter-parent', version: '2.4.3', ext: 'pom'
          
          }
          
          test {
              useJUnitPlatform()
          }
          
          
          subprojects {
              apply plugin: 'org.springframework.boot'
              apply plugin: 'io.spring.dependency-management'
              apply plugin: 'java'
          
              group = 'com.epam.esm'
              version = '1.0.0'
          
              repositories {
                  mavenCentral()
              }
              bootJar {
                  enabled = false
              }
          
              jar {
                  enabled = true
              }
              dependencies {
                  implementation 'org.springframework.boot:spring-boot-starter'
                  implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
                  implementation 'org.springframework.boot:spring-boot-starter-hateoas'
                  implementation 'org.springframework.boot:spring-boot-starter-actuator'
                  implementation 'org.springframework.boot:spring-boot-starter-security'
                  testImplementation 'org.springframework.boot:spring-boot-starter-test'
                  implementation group: 'org.hibernate', name: 'hibernate-envers', version: '5.4.27.Final'
                  implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
                  implementation group: 'org.openidentityplatform.commons', name: 'json-web-token', version: '2.0.11'
                  compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.18'
                  annotationProcessor 'org.projectlombok:lombok'
                  implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
                  implementation group: 'org.springframework.boot', name: 'spring-boot-starter-parent', version: '2.4.3', ext: 'pom'
              }
              test {
                  useJUnitPlatform()
              }
          }
  </code></pre>
  <p>SETTINGS.GRADLE</p>
  <pre><code>    rootProject.name = 'module'
      include('repository', 'service', 'controller')
  </code></pre>