title: Maven - compilation error even if dependency path is correct
body: <p>I manually added a jar file under the repository of Maven located in .m2/repository. </p>
  
  <p><a href="https://i.stack.imgur.com/JxIKr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JxIKr.png" alt="enter image description here"></a></p>
  
  <p>Then I also edited the pom.xml file of the project</p>
  
  <p><a href="https://i.stack.imgur.com/m0nZJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m0nZJ.png" alt="enter image description here"></a></p>
  
  <p>The jar file is also present under the Maven Dependencies</p>
  
  <p><a href="https://i.stack.imgur.com/LRXMN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LRXMN.png" alt="enter image description here"></a></p>
  
  <p>However, when I execute this command <code>mvn assembly:assembly -DdescriptorId=jar-with-dependencies package</code> under the root directory of the source files, I would get this error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project alexa-skills-kit-samples: Compilation failure: Compilation failure:
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/response/WowLampSmartControlResponse.java:[5,16] package org.json does not exist
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/http_request/WowLampSmartControlRequest.java:[7,16] package org.json does not exist
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/http_request/WowLampSmartControlRequest.java:[8,16] package org.json does not exist
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/http_request/WowLampSmartControlRequest.java:[16,19] cannot find symbol
  [ERROR] symbol:   class JSONObject
  [ERROR] location: class http_request.WowLampSmartControlRequest
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/http_request/WowLampSmartControlRequest.java:[30,62] cannot find symbol
  [ERROR] symbol:   class JSONException
  [ERROR] location: class http_request.WowLampSmartControlRequest
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/http_request/WowLampSmartControlRequest.java:[67,51] cannot find symbol
  [ERROR] symbol:   class JSONException
  [ERROR] location: class http_request.WowLampSmartControlRequest
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/response/WowLampSmartControlResponse.java:[127,24] cannot find symbol
  [ERROR] symbol:   class JSONException
  [ERROR] location: class response.WowLampSmartControlResponse
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/http_request/WowLampSmartControlRequest.java:[32,37] cannot find symbol
  [ERROR] symbol:   class JSONObject
  [ERROR] location: class http_request.WowLampSmartControlRequest
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/http_request/WowLampSmartControlRequest.java:[74,17] cannot find symbol
  [ERROR] symbol:   class JSONObject
  [ERROR] location: class http_request.WowLampSmartControlRequest
  [ERROR] /Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/src/main/java/wowlampsmartcontrol/http_request/WowLampSmartControlRequest.java:[74,45] cannot find symbol
  [ERROR] symbol:   class JSONObject
  [ERROR] location: class http_request.WowLampSmartControlRequest
  [ERROR] -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  </code></pre>
  
  <p>I don't understand why this happens.</p>
  
  <p>----- UPDATE -----</p>
  
  <p>I also tried adding the jar by command:</p>
  
  <pre><code>mvn install:install-file -Dfile=/Users/jun/Desktop/Projects/WowLamp/alexa-skills-kit-java-master/samples/lib/java-json.jar -DgroupId=json.java -DartifactId=java-json -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true
  </code></pre>
  
  <p>This is the hierarchy of the jar file after installation:</p>
  
  <p><a href="https://i.stack.imgur.com/dEkNP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dEkNP.png" alt="enter image description here"></a></p>
  
  <p>But still the same error occurs.</p>