title: Gradle grails - how to exclude dependency based on environment?
body: <p>I have a project where I want to include the console plugin for certain environments but not for others - it should go in the (custom) deployTest environment, but not for Production.</p>
  
  <p>If I build the app using grails, I have a BuildConfig.groovy that looks like:</p>
  
  <pre><code>grails.project.dependency.resolution = {
  
  /// some stuff
  
  plugins {
      /// more dependencies       
  
          if (Environment.current != Environment.PRODUCTION){
              compile ":console:1.5.1"
          }
  
  
      }
  }
  </code></pre>
  
  <p>Dependency resolution for Grails when using Gradle to build it is based on the build.gradle file, not the BuildConfig.groovy.</p>
  
  <p>How do I achieve this please?</p>