title: Springboot create a library from my model and repository classes
body: <p>I could not find a answer to this question so if there is I'm sorry for repeating question.</p>
  
  <p>I have 4 springboot apps (MICRO SERVICES ??), we have our main CRM on Oracle database running on Apex. Now over time Ive been trying to break it up. So I created some spring-boot apps for example I have one that is for google services eg: geo codeding, place searching etc. I have one that is for connecting our CRM to Xero online accounting service API and 3rd one that is running web-socket server so we can push messages to users of Oracle Apex. </p>
  
  <p>Now in all the projects I'm connecting to the same database so I have 4 copies of my Model and Repository classes. </p>
  
  <p>What I would like to do is to create a jar that has them and then share it across the projects. Now I can create a library but as I need to have spring deps in the library. </p>
  
  <p>I created this as my gradle.build </p>
  
  <pre><code>buildscript {
      ext {
          springBootVersion = '1.5.10.RELEASE'
      }
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'org.springframework.boot'
  
  group = 'com.example'
  version = '0.0.1'
  sourceCompatibility = 1.8
  
  repositories {
      mavenCentral()
  }
  
  
  dependencies {
      compile('org.springframework.boot:spring-boot-actuator-docs')
      compile('org.springframework.boot:spring-boot-starter-actuator')
      compile('org.springframework.boot:spring-boot-starter-data-jpa')
      compile('org.springframework.boot:spring-boot-starter-data-rest')
      compile('org.springframework.data:spring-data-rest-hal-browser')
      runtime('org.springframework.boot:spring-boot-devtools')
      compileOnly('org.springframework.boot:spring-boot-configuration-processor')
      compileOnly('org.projectlombok:lombok')
      testCompile('org.springframework.boot:spring-boot-starter-test')
  }
  </code></pre>
  
  <p>But I get a error if I don't have a application class with <code>@SpringbootApplication</code> annotation. </p>
  
  <p>I'm sure I'm missing something but I need to create a jar library with spring JPARepositories.</p>