title: disallow import of some transitive maven dependencies
body: <p>With maven we can exclude some transitive dependencies.</p>
  
  <p>But what if we need them at runtime, and still as architect I don't want them to be used and become API dependencies.</p>
  
  <p>Is there tool to define and check for unwanted used dependency (i.e. imported in some Java class)?</p>
  
  <p>A search here gives me hint for maven
  <a href="https://stackoverflow.com/questions/27654832/in-maven-can-you-disallow-usage-of-transitive-dependency-in-your-code-but-still">In maven, can you disallow usage of transitive dependency in your code but still keep it in the classpath?</a></p>
  
  <p>But that may be to laborious to define. Maybe IDE tools should be used?</p>
  
  <p><strong>How to disallow import and use of some transitive maven dependencies?</strong>
  So that code will not be accessing different layers of our stack.<br>
  Yes, I understand that some educational work should go as well.</p>