title: Maven package error: org.apache.commons-lang does not exist (Java)
body: <p>I'm using MyEclipse to develop a really simple Java Struts project. Everything was working fine until I wanted to use the <code>StringUtils</code> class in <strong>org.apache.commons.lang</strong>. In MyEclipse I imported the package like</p>
  
  <pre><code>import org.apache.commons.lang.StringUtils;
  </code></pre>
  
  <p>I added the Jar file for <strong>commons-lang-2.4</strong> to my build path. This all works fine and dandy and I get the Intellisense and no errors in Eclipse or anything. Now, when I go to do a <code>mvn clean package</code>, I get an error saying that </p>
  
  <blockquote>
    <p>The package org.apache.commons.lang does not exist</p>
  </blockquote>
  
  <p>I checked in my war/Pom.xml file and I do have it declared as a dependency</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.0.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;commons-lang&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>
  
  <p>From my research I figured that Maven should download the package and install it to my local repository if it doesn't exists. I checked the repository and the jar file was in there. I figured the jar file must be corrupted so I deleted the <strong>commons-lang</strong> folder to get a fresh download of commons-lang. Now this is where it blows my mind, after I deleted it from the local repository and ran a <code>mvn clean package</code>, it goes out and downloads the <strong>commons-lang-2.1</strong>.pom and jar (even though the pom.xml has 2.4) <strong>BUT</strong> still gives a compilation failure saying that <em>the package org.apache.commons.lang does not exist</em>. </p>
  
  <p>I haven't been using Maven for very long so I'm not sure how to go about fixing this. Am I missing something? Do I need to add the dependency in another pom.xml file somewhere else?</p>