Maven: Could Not find Artifact when trying to include a project in another one using dependencies
<h2>Problem description</h2>
<p>I have a project called <code>reservationVol</code> which I want to include in an mvc spring project called <code>reservationVolMvc</code>. I compiled and tested <code>reservationVol</code> on eclipse. I also use the maven commands: <code>mvn compile</code> and <code>mvn package</code>. All tests ran successfully.</p>
<p>When I tried to compile <code>reservationVolMvc</code> using the <code>mvn compile</code> command I get the following error:</p>
<pre><code>[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building reservationVolSpring 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for hani.reservationVol:reservationVol:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.688 s
[INFO] Finished at: 2016-11-23T12:25:21+01:00
[INFO] Final Memory: 6M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project reservationVolSpring: Could not resolve dependencies for project formation.addstones:reservationVolSpring:war:1.0-SNAPSHOT: Could not find artifact hani.reservationVol:reservationVol:jar:1.0-SNAPSHOT -&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/DependencyResolutionException
</code></pre>
<p>The following <strong>pom.xml</strong>  files represent the dependencies for respectively <code>reservationVol</code> and <code>reservationVolMvc</code>. I included the project <code>ReservationVol</code> in <code>reservationVolMvc</code> by using the following:</p>
<pre><code>&lt;dependency&gt;
    &lt;groupId&gt;hani.reservationVol&lt;/groupId&gt;
    &lt;artifactId&gt;reservationVol&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;/dependency&gt;
</code></pre>
<hr />
<h1>ReservationVol</h1>
<pre><code>  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
        xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
        &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
        &lt;groupId&gt;hani.reservationVol&lt;/groupId&gt;
        &lt;artifactId&gt;reservationVol&lt;/artifactId&gt;
        &lt;packaging&gt;jar&lt;/packaging&gt;
        &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
        &lt;name&gt;reservationVol&lt;/name&gt;
        &lt;dependencies&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;mysql&lt;/groupId&gt;
                &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
                &lt;version&gt;5.1.39&lt;/version&gt;
                &lt;scope&gt;compile&lt;/scope&gt;
            &lt;/dependency&gt;
            
             &lt;dependency&gt;
                &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
                &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
                &lt;version&gt;5.1.0.Final&lt;/version&gt;
            &lt;/dependency&gt;
            
            &lt;dependency&gt;
                &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
                &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
                &lt;version&gt;5.1.0.Final&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
                &lt;version&gt;4.2.6.RELEASE&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
                &lt;version&gt;4.2.6.RELEASE&lt;/version&gt;
            &lt;/dependency&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
                &lt;artifactId&gt;commons-dbcp2&lt;/artifactId&gt;
                &lt;version&gt;2.1.1&lt;/version&gt;
            &lt;/dependency&gt;
            
            &lt;dependency&gt;
                &lt;groupId&gt;junit&lt;/groupId&gt;
                &lt;artifactId&gt;junit&lt;/artifactId&gt;
                &lt;version&gt;4.12&lt;/version&gt;
                &lt;scope&gt;test&lt;/scope&gt;
            &lt;/dependency&gt;
           
            &lt;dependency&gt;
                &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
                &lt;version&gt;4.2.5.RELEASE&lt;/version&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;
    
        &lt;build&gt;
          &lt;plugins&gt;
            &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.3&lt;/version&gt;
              &lt;configuration&gt;
                &lt;source&gt;1.8&lt;/source&gt;
                &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
            &lt;/plugin&gt;
          &lt;/plugins&gt;
        &lt;/build&gt;
        
    &lt;/project&gt;
</code></pre>
<hr />
<h1>reservationVolMvc</h1>
<pre><code>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;formation.addstones&lt;/groupId&gt;
    &lt;artifactId&gt;reservationVolSpring&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;reservationVolSpring&lt;/name&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
                &lt;groupId&gt;hani.reservationVol&lt;/groupId&gt;
                &lt;artifactId&gt;reservationVol&lt;/artifactId&gt;
                &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
            &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
            &lt;version&gt;2.7.5&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;jstl&lt;/groupId&gt;
            &lt;artifactId&gt;jstl&lt;/artifactId&gt;
            &lt;version&gt;1.2&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
            &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
            &lt;version&gt;2.2&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
            &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
            &lt;version&gt;3.1.0&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
            &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
            &lt;version&gt;4.2.6.RELEASE&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
            &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
            &lt;version&gt;4.2.6.RELEASE&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;javax.validation&lt;/groupId&gt;
            &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
            &lt;version&gt;1.0.0.GA&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
            &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
            &lt;version&gt;4.3.2.Final&lt;/version&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                &lt;version&gt;3.5.1&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;source&gt;1.8&lt;/source&gt;
                    &lt;target&gt;1.8&lt;/target&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;
&lt;/project&gt;
</code></pre>