title: Using Maven properties to connect to a database
body: <p>I have a Maven project that runs some tests against a database. I can run these tests using <code>mvn clean verify</code> but I want to specify some database properties eg. database name, port name etc... in my pom.xml file that I can use within Java to create a database connection.</p>
  
  <p>I have added this to my POM,</p>
  
  <pre><code>  &lt;properties&gt;
      &lt;server&gt;localhost&lt;/server&gt;
      &lt;database&gt;mydatabase&lt;/database&gt;
      &lt;port&gt;1433&lt;/port&gt;
    &lt;/properties&gt;
  </code></pre>
  
  <p>Can I access these properties from my Java code, or will I need to create a Maven plugin and pass these properties as parameters to my plugin and call <code>clean verify</code> from my custom plugin?</p>