title: Unable to build adapters using profiles and properties in Maven
body: <p>I have created an http adapter using <code>mfpdev adapter create</code>
  but I found out the adatper.xml configuration file contains server connection configuration which I would like to change accordingly to dev,test,produciton 
  environment.</p>
  
  <p>So I tried to use maven resource filter by changing the pom.xml as following</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.my.adapter&lt;/groupId&gt;
  &lt;artifactId&gt;MYAPIAdapter&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;adapter&lt;/packaging&gt;
  &lt;name&gt;MYAPIAdapter&lt;/name&gt;
  
  &lt;properties&gt;
      &lt;!-- Use UTF-8 as the encoding of the adapter --&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  
      &lt;!-- MobileFirst adapter deployment properties --&gt;
      &lt;mfpfUrl&gt;http://localhost:9080/mfpadmin&lt;/mfpfUrl&gt;
      &lt;mfpfUser&gt;admin&lt;/mfpfUser&gt;
      &lt;mfpfPassword&gt;admin&lt;/mfpfPassword&gt;
      &lt;mfpfRuntime&gt;mfp&lt;/mfpfRuntime&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.ibm.mfp&lt;/groupId&gt;
          &lt;artifactId&gt;adapter-maven-api&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
          &lt;version&gt;[8.0.0,9.0.0)&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.ibm.mfp&lt;/groupId&gt;
          &lt;artifactId&gt;mfp-security-checks-base&lt;/artifactId&gt;
          &lt;version&gt;[8.0.0,9.0.0)&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.ibm.mfp&lt;/groupId&gt;
              &lt;artifactId&gt;adapter-maven-plugin&lt;/artifactId&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
      &lt;filters&gt;
          &lt;filter&gt;profiles/${build.profile.id}/config.properties&lt;/filter&gt;
      &lt;/filters&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/adapter-resources&lt;/directory&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
          &lt;/resource&gt;
  &lt;/resources&gt;
  &lt;/build&gt;
  
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;pc&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;build.profile.id&gt;pc&lt;/build.profile.id&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;sit&lt;/id&gt;
          &lt;properties&gt;
              &lt;build.profile.id&gt;sit&lt;/build.profile.id&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;uat&lt;/id&gt;
          &lt;properties&gt;
              &lt;build.profile.id&gt;uat&lt;/build.profile.id&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;prod&lt;/id&gt;
          &lt;properties&gt;
              &lt;build.profile.id&gt;prod&lt;/build.profile.id&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>adapter.xml</strong></p>
  
  <pre><code>&lt;mfp:adapter name="MYAPIAdapter"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:mfp="http://www.ibm.com/mfp/integration"
           xmlns:http="http://www.ibm.com/mfp/integration/http"&gt;
  
  &lt;displayName&gt;MYAPIAdapter&lt;/displayName&gt;
  &lt;description&gt;MYAPIAdapter&lt;/description&gt;
  &lt;connectivity&gt;
      &lt;connectionPolicy xsi:type="http:HTTPConnectionPolicyType"&gt;
          &lt;protocol&gt; ${connect.protocol}&lt;/protocol&gt;
          &lt;domain&gt; ${connect.domain}&lt;/domain&gt;
          &lt;port&gt; ${connect.port}&lt;/port&gt;
          &lt;connectionTimeoutInMilliseconds&gt; ${connect.timeout.ms}&lt;/connectionTimeoutInMilliseconds&gt;
          &lt;socketTimeoutInMilliseconds&gt; ${connect.sockettimeout.ms}&lt;/socketTimeoutInMilliseconds&gt;
          &lt;maxConcurrentConnectionsPerNode&gt; ${max.concurrentconnections}&lt;/maxConcurrentConnectionsPerNode&gt;
      &lt;/connectionPolicy&gt;
  &lt;/connectivity&gt;
  
  &lt;procedure name="getFeed"/&gt;
  &lt;procedure name="unprotected" secured="false"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>When I run <code>mvn install</code> , I hit following error , seem like mfp maven plugin validate the adapter xml file. I have no problem running with <code>mvn compile</code> and the adapter xml values is succesfully replaced with the values in properties file. Is there anyway to specify the configuration from properties file when building the mfp adapter? </p>
  
  <pre><code>ERROR] Failed to execute goal com.ibm.mfp:adapter-maven-plugin:8.0.2016082422:build (default-build) on project MYAPIAdapter: Adapter xml file schema validation encountered errors: [cvc-datatype-valid.1.2.1: '${connect.port}' is not a valid value for 'integer'., cvc-type.3.1.3: The value '${connect.port}' of element 'port' is not valid., cvc-datatype-valid.1.2.1: '${connect.timeout.ms}' is not a valid value for 'integer'., cvc-type.3.1.3: The value '${connect.timeout.ms}' of element 'connectionTimeoutInMilliseconds' is not valid., cvc-datatype-valid.1.2.1: '${connect.sockettimeout.ms}' is not a valid value for 'integer'., cvc-type.3.1.3: The value '${connect.sockettimeout.ms}' of element 'socketTimeoutInMilliseconds' is not valid., cvc-datatype-valid.1.2.1: '${max.concurrentconnections}' is not a valid value for 'integer'., cvc-type.3.1.3: The value '${max.concurrentconnections}' of element 'maxConcurrentConnectionsPerNode' is not valid.] -&gt; [Help 1] [ERROR] 
  </code></pre>