title: Error: Could not find or load main class After creating jar for multi-module project
body: <p>I am using IntelliJ and gradle to create a multi-module spring project as shown below.
  With the following build.gradle in the root folder, I have the following settings below. When invoked gradle build, a jar gets created in build/libs, however executing that jar I get the error message: 
  **Error: Could not find or load main class com.connect.configuration.ConnectApplication
  ** When running the application without building via: gradle bootRun -- the application loads up correctly. However, executing the jar file after building the project, produces the error and the jar prints out the following: using </p>
  
  <pre><code>jar -tf myJar.jar
  META-INF/
  META-INF/MANIFEST.MF
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/WWAqF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WWAqF.png" alt="enter image description here"></a></p>
  
  <pre><code>plugins {
      id 'io.spring.dependency-management' version '1.0.8.RELEASE'
      id 'java'
  }
  
  subprojects {
      group = 'com.connect.connect'
      version = '0.0.1-SNAPSHOT'
  
      sourceCompatibility = 1.9
      targetCompatibility = 1.9
  
      apply plugin: 'java'
      apply plugin: 'io.spring.dependency-management'
      apply plugin: 'java-library'
  
      repositories {
          jcenter()
      }
  
      dependencies {
          compileOnly 'org.projectlombok:lombok:1.18.10'
          annotationProcessor 'org.projectlombok:lombok:1.18.10'
      }
      dependencyManagement {
          imports {
              mavenBom("org.springframework.boot:spring-boot-dependencies:2.1.9.RELEASE")
          }
      }
  }
  </code></pre>
  
  <p><strong>settings.gradle</strong></p>
  
  <pre><code>include 'connect-common'
  include 'connect-ui'
  include 'connect-services'
  include 'connect-application'
  include 'connect-configuration'
  </code></pre>