title: Could not resolve dependencies, Failed to read artifact descriptor, Failed to collect dependencies
body: <p>There is a project myProject that has two modules and moduleB has a dependency on moduleA. moduleA builds successfully and is deployed on nexus but when  you try to deploy moduleB you get the following error: </p>
  
  <pre><code>[ERROR] Failed to execute goal on project moduleB: 
  Could not resolve dependencies for project groupId:moduleB:jar:1.0-SNAPSHOT 
  Failed to collect dependencies at groupId:moduleA:jar:1.0-SNAPSHOT: 
  Failed to read artifact descriptor for groupId:moduleA:jar:1.0-SNAPSHOT: 
  Could not find artifact groupId:myProject:pom:1.0-SNAPSHOT -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: 
  Failed to execute goal on project moduleB: 
  Could not resolve dependencies for project groupId:moduleB:jar:1.0-SNAPSHOT:
  Failed to collect dependencies at groupId:moduleA:jar:1.0-SNAPSHOT
  </code></pre>
  
  <p>Or sometimes this one:</p>
  
  <pre><code>[ERROR] Failed to execute goal on project moduleB: 
  Could not resolve dependencies for project groupId:moduleB:jar:1.0-SNAPSHOT 
  Failed to collect dependencies at groupId:moduleA:jar:1.0-SNAPSHOT: 
  Failed to read artifact descriptor for groupId:moduleA:jar:1.0-SNAPSHOT:
  Failure to find groupId:myProject:pom:360 
  in http://lonrs07557:8081/nexus/content/groups/public/  was cached in the local repository, 
  resolution will not be reattempted until the update interval 
  of myProject_maven_repo has elapsed or updates are forced.
  </code></pre>
  
  <p>I've looked around for solutions but I get different errors each time and it gets chaotic. I've tried doing a clean -U, a dependency tree, an effective pom and many more (unsuccessfully). My maven repo is set up correctly:</p>
  
  <pre><code>   &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;nexus&lt;/id&gt;
              &lt;name&gt;nexus repository&lt;/name&gt;
              &lt;url&gt;http://lonrs07557:8081/nexus/content/groups/repo&lt;/url&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
    [...]
    &lt;distributionManagement&gt;
          &lt;site&gt;
              &lt;id&gt;lonrs07557-docs&lt;/id&gt;
              &lt;name&gt;Documentation Repository&lt;/name&gt;
              &lt;url&gt;scp://lonrs07557:9999/content/maven/site-documentation&lt;/url&gt;
          &lt;/site&gt;
          &lt;repository&gt;
               &lt;id&gt;lonrs07557-releases&lt;/id&gt;
               &lt;name&gt;Release Repository&lt;/name&gt;
               &lt;url&gt; dav:http://lonrs07557:8081/nexus/content/repositories/releases&lt;/url&gt;
         &lt;/repository&gt;
          &lt;snapshotRepository&gt;
              &lt;id&gt;lonrs07557-snapshots&lt;/id&gt;
              &lt;name&gt;Snapshot Repository&lt;/name&gt;
              &lt;url&gt;dav:http://lonrs07557:8081/nexus/content/repositories/snapshots&lt;/url&gt;
              &lt;uniqueVersion&gt;false&lt;/uniqueVersion&gt;
          &lt;/snapshotRepository&gt;
      &lt;/distributionManagement&gt;
  </code></pre>
  
  <blockquote>
    <p>One of the problems is that is looking for an older version of the master pom (although that older version it's not referenced anywhere).</p>
    
    <p>There is another warning that a pom is missing, however I can see it in nexus. </p>
  </blockquote>
  
  <pre><code>[WARNING] The POM for groupId:log-util:jar:1.0-SNAPSHOT is missing, 
  no dependency information available
  </code></pre>
  
  <p>Also when I was building locally everything was successful, when I was doing it later on through TeamCity it was failing upon the aforementioned, so in my efforts to reproduce the problem locally, I deleted my local maven repo and it got forced to create a new one which resulted in the same errors. Then I worked around this problem by actually building moduleA first and then moduleB. However, I cannot use the same workaround when I do it throught the TeamCity agent. </p>
  
  <p>The way I'm running it (locally and in TeamCity) is:</p>
  
  <pre><code>mvn clean deploy -f moduleB/pom.xml -U -X 
  </code></pre>
  
  <p>settings.xml
      </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;localRepository&gt;c:/maven/repository&lt;/localRepository&gt;
  &lt;pluginGroups&gt;
          &lt;pluginGroup&gt;org.mortbay.jetty&lt;/pluginGroup&gt;
          &lt;pluginGroup&gt;com.totsp.gwt&lt;/pluginGroup&gt;
      &lt;/pluginGroups&gt;
  
      &lt;servers&gt;
          &lt;server&gt;
              &lt;id&gt;lonrs07563-docs&lt;/id&gt;
              &lt;username&gt;XXXXX&lt;/username&gt;
              &lt;password&gt;XXXXX&lt;/password&gt;
              &lt;configuration&gt;
              &lt;knownHostsProvider
                  implementation="org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider"&gt;
                  &lt;hostKeyChecking&gt;no&lt;/hostKeyChecking&gt;
              &lt;/knownHostsProvider&gt;
              &lt;/configuration&gt;
          &lt;/server&gt;
          &lt;server&gt;
              &lt;id&gt;lonrs07557-releases&lt;/id&gt;
              &lt;username&gt;XXXXX&lt;/username&gt;
              &lt;password&gt;XXXXX&lt;/password&gt;
          &lt;/server&gt;
          &lt;server&gt;
              &lt;id&gt;lonrs07557-snapshots&lt;/id&gt;
              &lt;username&gt;XXXXX&lt;/username&gt;
              &lt;password&gt;XXXXX&lt;/password&gt;
          &lt;/server&gt;
      &lt;/servers&gt;
  
      &lt;mirrors&gt;
          &lt;mirror&gt;
              &lt;id&gt;myProject_maven_repo&lt;/id&gt;
              &lt;mirrorOf&gt;*&lt;/mirrorOf&gt;
              &lt;url&gt;http://lonrs07557:8081/nexus/content/groups/public/&lt;/url&gt;
          &lt;/mirror&gt;
      &lt;/mirrors&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;local&lt;/id&gt;
              &lt;activation&gt;
                              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;properties&gt;
                  &lt;clusterport&gt;${env.MYPROJECT_CLUSTER_PORT}&lt;/clusterport&gt;
                  &lt;clusteraddress&gt;${env.MYPROJECT_CLUSTER_ADDRESS}&lt;/clusteraddress&gt;
                  &lt;hostname&gt;${env.hostname}&lt;/hostname&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/settings&gt;
  </code></pre>