title: Three maven project A depends on B, B depends on C, how to make C invisible to A on compile time?
body: <p>In a web application, my project A (Front end) has a dependency on project B (Business layer).</p>
  
  <p>Project B has a dependency on project C (Repository layer).</p>
  
  <p>Thus, a class located in project C (Repo) can be instantiated in project A (Front). But obviously I do not want this. </p>
  
  <p>I tried to declare an exclusion in the project's A pom.xml to exclude project C while declaring the dependency on project B - but when the WAR is built, the project's C jar is excluded from the final WAR. </p>
  
  <p>How do I exclude project C from project a at compile time but not at WAR build time or runtime ? </p>