title: Make a maven dependency provided based on active spring profile
body: <p>So I am building a spring boot web application, packaging as a war, and deploying to a tomcat application server.</p>
  
  <p>I have the following dependency in my pom.xml for tomcat:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The scope of this dependency needs to be provided in order to be able to deploy it to a tomcat instance. However, when I want to run the war via the spring boot CLI or via IntelliJ's default spring boot run configuration, I need to remove the <code>&lt;scope&gt;provided&lt;/scope&gt;</code> in order for it to run the embedded tomcat.</p>
  
  <p>My question is, is there some way to make the dependency conditionally provided based on an active spring profile, or some other method?</p>