title: dependency not found at runtime maven
body: <p>I'm new to maven and somewhat new to java. Tried google and related sources, but I didn't find one which resembled my situation.</p>
  
  <p>Right now, I have maven project <code>X</code> and <code>Y</code>. <code>X</code> can be seen as a shared library with some utilities, <code>Y</code> is a simple <code>JFrame</code> with a <code>"hello world"</code> printed and a call to a static method in <code>X</code>.</p>
  
  <p>I do a "run as <code>maven install</code>" on project <code>X</code>, I get a <code>"build successful"</code>. I add project <code>X</code> as dependency in project <code>Y</code> (using the pom-editor in Eclipse, browsing the repository and locating it). I do a "run as <code>maven package</code>" on project <code>Y</code>, I get a <code>"build successful"</code>. Upon running project <code>Y</code> either via <code>java -jar</code> or inspect the produced jar, project <code>X</code> is missing everywhere and I get a fancy class not found exception. Eclipse finds it and there are no compile errors in the source editor.</p>
  
  <p>Why is it only working in the Eclipse editor and not as jar?</p>
  
  <p>POM:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.company.deployment.shared&lt;/groupId&gt;
          &lt;artifactId&gt;com.company.deployment.shared&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>