title: maven build error: package org.apache.http does not exist
body: <p>I am attempting to send a simple HTTP post from a java program (for deploying on Heroku).
  I started with the demo project <a href="https://github.com/heroku/devcenter-java-worker" rel="noreferrer">here</a>.
  Using <code>mvn package</code> builds the project successfully.</p>
  
  <p>I then added my own additional file TestPost.java with a few lines of code, added it to the <code>pom.xml</code>, and still built fine.</p>
  
  <p>Then I tried to add the HTTP code from <a href="http://hc.apache.org/httpcomponents-client-4.5.x/httpclient/examples/org/apache/http/examples/client/QuickStart.java" rel="noreferrer">this example</a> (minus the <code>package</code> line), which uses the Apache HttpClient library.  </p>
  
  <p>Using <code>mvn package</code> results in the following error:</p>
  
  <pre><code>package org.apache.http does not exist 
  </code></pre>
  
  <p>After searching for solutions I tried including a dependency in the <code>pom.xml</code>:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.5.2&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>My understanding was that this should force a download of the necessary package but no download was shown on the next compile (just the same error), and the package is not visible in my user .m2\repository\ folder.</p>
  
  <p>I tried inserting this dependency at different points in my <code>pom.xml</code> without success.</p>
  
  <p>Why is the apache library not being downloaded? Please note that I am new to maven.</p>