title: maven profile can't get the site.url
body: <p>working with java project with Maven and TestNG. Trying to put environment variables into maven profiles and call them on with mvn clean install -Pdevhost</p>
  
  <p>The problen is that browser can't get a siteurl. Error: </p>
  
  <pre><code>java.lang.NullPointerException: null value in entry: url=null
  </code></pre>
  
  <p>Pom file profiles:</p>
  
  <pre><code>  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.7.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.21.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;suiteXmlFiles&gt;
                      &lt;file&gt;${project.basedir}/suites/smoke.xml&lt;/file&gt;
                  &lt;/suiteXmlFiles&gt;
                  &lt;systemPropertyVariables&gt;
                      &lt;environment.properties&gt;/environment.properties&lt;/environment.properties&gt;
                  &lt;/systemPropertyVariables&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
      &lt;testResources&gt;
          &lt;testResource&gt;
              &lt;directory&gt;src\test\resources&lt;/directory&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
          &lt;/testResource&gt;
      &lt;/testResources&gt;
  
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src\test\resources&lt;/directory&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
  
  &lt;/build&gt;
  
      &lt;!-- Profiles configuration --&gt;
      &lt;profiles&gt;
  
          &lt;!--Environments "mvn test -P dev3"--&gt;
  
          &lt;profile&gt;
              &lt;id&gt;devhost&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;properties&gt;
                  &lt;site.url&gt;https://siteurl.com&lt;/site.url&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>The file with properties called as "environment.properties" file and is located under src/test/resources:</p>
  
  <pre><code>site.url=${site.url}
  </code></pre>
  
  <p>Java class where driver gets the siteurl:</p>
  
  <pre><code>public void SetUp() {
  
  
      driver = new ChromeDriver();
      System.setProperty("webdriver.chrome.driver", 
      ConfigFileReader.getDriverPath());
  
      driver.manage().window().maximize();
  
      driver.get(System.getProperty("site.url"));
  
      driver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);
  </code></pre>