title: Maven - Do you need a main to use a project as a library?
body: <p>I'm working on a project where I have a "core" and an "API" that are two separate maven projects.</p>
  
  <p>Currently, I'm exporting the API in a jar using Eclipse and I'm linking it in maven like that :</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.project.my&lt;/groupId&gt;
      &lt;artifactId&gt;project-api&lt;/artifactId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;scope&gt;system&lt;/scope&gt;
      &lt;systemPath&gt;${project.basedir}/src/main/resources/dependencies/project-api.jar&lt;/systemPath&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>It's working properly and I can use the classes defined in my API.</p>
  
  <p>But now I want to have a better workflow and I'm trying to install the API in my local maven repository and then link it normaly in the core :</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.project.my&lt;/groupId&gt;
      &lt;artifactId&gt;project-api&lt;/artifactId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>But when I run <code>maven clean install</code> I'm getting the following error :</p>
  
  <pre><code>Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:repackage failed: Unable to find main class
  </code></pre>
  
  <p>And I indeed don't have a main in my API, since I don't need one.</p>
  
  <p>Note that I use <code>spring-boot</code> for both projects, as I'm using some of their dependencies and it's easier to let them manage the versions (I only use the utility classes in the API).</p>
  
  <p>So I'd like to know if I HAVE to have a main anyway, even if I don't ever use it, or if I'm doing something wrong trying to install my API in the local repository ?</p>
  
  <p>Thanks :)</p>