title: Gradle run configurations with different properties
body: <p>Here is my inputs:</p>
  
  <p>Main.java</p>
  
  <pre><code>package com;
  
  public class Main {
  
      public static void main(String[] args) {
          System.out.println(System.getProperty("greeting.language"));
      }
  }
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>apply plugin: 'java'
  apply plugin: 'application'
  
  sourceCompatibility = 1.7
  version = '1.0'
  
  mainClassName = "com.Main"
  
  applicationDefaultJvmArgs = ["-Dgreeting.language=en"]
  </code></pre>
  
  <p>My question: How can I configure another run task configuration to use different jvm arguments, for example: -Dgreeting.language=ch. </p>
  
  <p>I moved to gradle from maven, so for such case I would use maven profiles. Is there any strucrure in gradle which corresponds to profiles? </p>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>Let me clarify a task a little bit. My project is far more complex that example I gave above. I would like to have a set of gradle tasks(or profiles/or whatever it's called in gradle), each of the task should be self-contained with custom set of variables. As an output I would like to have set of gradle task: </p>
  
  <pre><code>gradle &lt;enableAllFeatures&gt;
  gradle &lt;disableFeatureA&gt;
  ...
  </code></pre>
  
  <p>It is not a requirement for these variables to be JvmArgs. It could be constants(or whatever possible in gradle) but it is <strong>requirement to have different tasks</strong>, and <strong>each task should specify it's own set of variables</strong></p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I was surfing internet and found out very interesting topic - <strong>gradle build variants</strong>, but it is seems to be applicable only to android projects. Is it possible to use build variants in java projects?</p>