How to configure pom.xml file to use Nexus Repository manager
<p>I am using <code>Redhat</code>, <code>java 1.7</code>, <code>maven 3.2.5</code>, <code>jenkins 1.6</code>,<code>git version 2.0.5</code> and <code>nexus-2.12.0-01</code> </p>

<p>I have created a Local <code>Nexus Repository</code> for my internal development.
Now What I am trying to do is, to build <code>maven</code> project using <code>jenkins</code> with <code>Nexus Repository Manger Oss</code>.
I am able to build my project without <code>Nexus Repository Manger Oss</code>.</p>

<p><em>Note : I am using parent <code>pom</code> since I have to sub projects.</em></p>

<p><strong>Below are the steps that I followed</strong>.</p>

<ul>
<li><p>Installed <code>Nexus Repository Manger Oss</code>. It is up and running<br>
here is screen-shot.</p>

<p><img src="https://i.stack.imgur.com/rzm7t.png" alt="Nexus repository is up and running "></p></li>
<li><p>Installed ojdbc5 jar in nexus repository </p>

<p><img src="https://i.stack.imgur.com/Kzi7T.png" alt="2"></p></li>
<li><p>Made necessary changes in setting.xml file of .m2 folder</p></li>
</ul>

<p><strong>here the content of <code>setting.xml</code></strong></p>

<pre><code>&lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0                                                           http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;

    &lt;mirrors&gt;
        &lt;mirror&gt;
        &lt;!--This sends everything else to /public --&gt;
            &lt;id&gt;nexus&lt;/id&gt;
            &lt;mirrorOf&gt;*&lt;/mirrorOf&gt;
            &lt;url&gt;http://localhost:8081/nexus/content/groups/public&lt;/url&gt;
        &lt;/mirror&gt;
    &lt;/mirrors&gt;

    &lt;activeProfiles&gt;
        &lt;!--make the profile active all the time --&gt;
        &lt;activeProfile&gt;nexus&lt;/activeProfile&gt;
    &lt;/activeProfiles&gt;

    &lt;profiles&gt;
        &lt;profile&gt;
            &lt;id&gt;nexus&lt;/id&gt;
          &lt;repositories&gt;
          &lt;repository&gt;
          &lt;id&gt;central&lt;/id&gt;
          &lt;url&gt;http://maven.apache.org&lt;/url&gt;
          &lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
          &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
          &lt;/repository&gt;
            &lt;/repositories&gt;

            &lt;pluginRepositories&gt;
                &lt;pluginRepository&gt;
                    &lt;id&gt;central&lt;/id&gt;
                    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
                    &lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
                    &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
                &lt;/pluginRepository&gt;
            &lt;/pluginRepositories&gt;
        &lt;/profile&gt;
    &lt;/profiles&gt;

    &lt;servers&gt;
      &lt;server&gt;
       &lt;id&gt;releases&lt;/id&gt;
       &lt;username&gt;deployment&lt;/username&gt;
       &lt;password&gt;deployment123&lt;/password&gt;
      &lt;/server&gt;
      &lt;server&gt;
        &lt;id&gt;snapshots&lt;/id&gt;
        &lt;username&gt;deployment&lt;/username&gt;
        &lt;password&gt;deployment123&lt;/password&gt;
      &lt;/server&gt;
    &lt;/servers&gt;

&lt;/settings&gt; 
</code></pre>

<ul>
<li>Added the details of nexus repository in my <code>pom.xml</code></li>
</ul>

<p><strong>parent <code>pom.xml</code> content</strong></p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;parent&lt;/groupId&gt;
  &lt;artifactId&gt;A&lt;/artifactId&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;Maven Webapp&lt;/name&gt;
  &lt;!--url&gt;http://maven.apache.org&lt;/url--&gt;

  &lt;distributionManagement&gt;
    &lt;repository&gt;
      &lt;id&gt;releases&lt;/id&gt;
      &lt;url&gt;http://localhost:8081/nexus/content/repositories/thirdparty/&lt;/url&gt;
    &lt;/repository&gt;
    &lt;snapshotRepository&gt;
      &lt;id&gt;snapshots&lt;/id&gt;
      &lt;url&gt;http://localhost:8081/nexus/content/repositories/snapshots/&lt;/url&gt;
    &lt;/snapshotRepository&gt;
  &lt;/distributionManagement&gt;

  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.oracle&lt;/groupId&gt;
      &lt;artifactId&gt;ojdbc5&lt;/artifactId&gt;
      &lt;version&gt;11.2.0.1&lt;/version&gt;
    &lt;/dependency&gt;
  &lt;/dependencies&gt;

  &lt;modules&gt;
    &lt;module&gt;subModule1&lt;/module&gt;
    &lt;module&gt;subModule2&lt;/module&gt;
  &lt;/modules&gt;
&lt;/project&gt;
</code></pre>

<p><strong>SubModule1's pom.xml</strong></p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.a&lt;/groupId&gt;
  &lt;artifactId&gt;a&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;Maven Webapp&lt;/name&gt;

  &lt;distributionManagement&gt;
    &lt;repository&gt;
      &lt;id&gt;releases&lt;/id&gt;
      &lt;!-- CHANGE HERE by your team nexus server --&gt;
      &lt;url&gt;http://localhost:8081/nexus/content/repositories/thirdparty/&lt;/url&gt;
    &lt;/repository&gt;
    &lt;snapshotRepository&gt;
      &lt;id&gt;snapshots&lt;/id&gt;
      &lt;!-- CHANGE HERE by your team nexus server --&gt;
      &lt;url&gt;http://localhost:8081/nexus/content/repositories/snapshots/&lt;/url&gt;
    &lt;/snapshotRepository&gt;
  &lt;/distributionManagement&gt;

  &lt;dependencies&gt;
    // dependecies are defined here
  &lt;dependencies&gt;
</code></pre>

<p>In <code>subModule1</code> and <code>subModule2</code> I have added the <code>distributionManagement</code> section.  </p>

<p>But when I build my project I get the below error.</p>

<blockquote>
  <p>[ERROR] Failed to execute goal on project submodule1: Could not
  resolve dependencies for project submodule1:war:1.0-SNAPSHOT: Failure
  to find com.oracle:ojdbc5:jar:11.2.0.1 in
  <a href="https://repo.maven.apache.org/maven2" rel="nofollow noreferrer">https://repo.maven.apache.org/maven2</a> was cached in the local
  repository, resolution will not be reattempted until the update
  interval of central has elapsed or updates are forced -> [Help 1]</p>
</blockquote>

<p>I understand the error is caused by the <code>com.oracle:ojdbc5:jar:11.2.0.1</code>jar dependency not being resolvable.</p>

<p>But I am surprised why it is not picking it up from my local nexus repository.</p>

<p>Have I missed any configuration, or am I doing it in a wrong way?</p>

<p>How do I use local nexus repository for my projects?</p>