title: Maven Profile reads data from Properties file
body: <p>I have a Selenium project which uses Maven as a build tool and I want to read different environment details (protocol, domain, subdomain, etc) from a .properties file. Would it be possible to use Maven profiles in order to run my tests on different environments such as dev, staging, prod based on the profile which I am specifying when triggering the mvn command?</p>
  
  <p>dev.properties:</p>
  
  <pre><code>protocol=http
  domain=domain.com
  subdomain=www
  </code></pre>
  
  <p>pom.xml:</p>
  
  <pre><code>  &lt;profiles&gt;
      &lt;profile&gt;
        &lt;id&gt;prod&lt;/id&gt;
        &lt;activation&gt;
         &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
        &lt;/activation&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
        &lt;id&gt;pre_prod&lt;/id&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
        &lt;id&gt;dev&lt;/id&gt;
      &lt;/profile&gt;
    &lt;/profiles&gt;
  </code></pre>
  
  <p>mvn:</p>
  
  <pre><code>mvn clean test -Pdev
  </code></pre>
  
  <p>Data should then be retrieved in the java code using</p>
  
  <pre><code>System.getProperty("protocol");
  System.getProperty("domain");
  System.getProperty("subdomain");
  </code></pre>
  
  <p>Any help would be very much appreciated.</p>
  
  <p>Thanks!</p>