title: How to make non executable library (jar) using spring boot?
body: <p>I am working on an application and deploying in cloud foundry. Internally it is having 3 custom dependencies developed by our team.</p>
  
  <p>All 3 dependencies are boot project and have their <code>@Configuration</code>.</p>
  
  <ul>
  <li>Dependency 1 is to interact with Couchbase. Source of this dependency is boot project.</li>
  <li>Dependency 2 is to interact with FluentD for logging. Source of this dependency is boot project.</li>
  <li>Dependency 3 is to interact with external rest service. Source of this dependency is boot project.</li>
  <li>Dependency 4 is having all these above 3 dependencies and also having few utils classes and constants.</li>
  </ul>
  
  <p>I am using this dependency 4 in multiple web applications which are having WebMVC implementation.</p>
  
  <p>Everything is working fine in my local machine. But when I am pushing this web application on cloud, sometimes libraries getting executed before the web application which is crashing my app intermittently. Good thing app is getting recover in few seconds. </p>
  
  <p>I did below changes in my libraries (jars/dependencies) and tried on cloud. After doing these changes ratio of app crash reduces, but unfortunately it is still crashing sometimes and I am able to see dependencies gets executed before application.</p>
  
  <ul>
  <li>Added bootRepackage.enabled = false bootRepackage.withJarTask = jar in library's build.gradle</li>
  <li>Took off from library and added in my web application
  springBoot {
  mainClass  = "com.java.Application"
  executable = true
  } </li>
  <li>Took off <code>@SpringBootApplication</code> from libraries(dependencies/jars). It's just in my web application now.</li>
  </ul>
  
  <p>I do not know these are the only steps to make a boot dependency non-executable or I would have to do something else. Please let me know if I am missing something.</p>
  
  <p>Here is the sample off application class of one of my dependency.</p>
  
  <pre><code>import org.springframework.context.annotation.ComponentScan;
  
    @ComponentScan
    public class LoggingApplication {
  
    }
  
  Sample of Web application main class.
    @SpringBootApplication
    @EnableWebMvc
    @Import(LoggingApplication.class) 
    public class Application {
  
  
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
    }
  </code></pre>