title: Why sbt runs dependency resolution every time after clean?
body: <p>SBT runs dependency resolution every time after <code>clean</code> even if project dependency management configuration hasn't changed. This is time consuming when running on CI server.</p>
  
  <p>But documentation <a href="http://www.scala-sbt.org/0.12.3/docs/Detailed-Topics/Dependency-Management-Flow.html" rel="noreferrer">says</a>:</p>
  
  <blockquote>
    <ol>
    <li>Normally, if no dependency management configuration has changed since the last successful resolution and the retrieved files are still
    present, sbt does not ask Ivy to perform resolution.</li>
    </ol>
  </blockquote>
  
  <p>How can I stop sbt from doing dependency resolution every time I build project with <code>sbt clean publish-local</code> ?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I've discovered that sbt also runs resolution when I enter in interactive mode with <code>sbt</code>.</p>
  
  <p><strong>Update2</strong></p>
  
  <p>As <code>@Ezhik</code> pointed if I can preserve <code>target/resolution-cache</code> then sbt will not resolve dependencies after clean.
  So I tried to move <code>resolution-cache</code> out from target dir:</p>
  
  <pre><code>ivyConfiguration &lt;&lt;= (externalResolvers, ivyPaths, offline, checksums, appConfiguration, target, streams) map { (rs, paths, off, check, app, t, s) =&gt;
          val resCacheDir = t / ".." / "resolution-cache"
          new InlineIvyConfiguration(paths, rs, Nil, Nil, off, Option(lock(app)), check, Some(resCacheDir), s.log)
        }
  </code></pre>
  
  <p>Now with this code in <code>Build.scala</code> resolution cache is placed in project root and is therefore preserved after <code>clean</code>, but resolution is being done anyway. So I assume this approach is wrong or insufficient.</p>