title: How to tell Maven to ignore a dependency if failed to resolve it?
body: <p>I have a dependency which I have installed in Maven local repository and is being used locally but is not available on deployment server. I use that dependency using <code>Class.forName(...)</code> so there will be no problem if it's missed from classpath on deployment server.</p>
  
  <p>Is there any way to tell Maven to ignore a dependency if it failed to resolve it?</p>
  
  <p>I doesn't seem that <code>&lt;scope&gt;</code> or <code>&lt;optional&gt;</code> can solve this problem, but it may be possible to do it with <code>&lt;profiles&gt;</code> if there is any way to activate/deactivate a profile based on dependencies availability.</p>