How to set the value of a jdbc-connection-pool property in glassfish-resources.xml with a property from pom.
For example, my pom.xml
...
<profiles>
<profile>
<id>dev</id>
<properties>
<database.dbname>Xpto</database.dbname>
...
</properties>
</profile>
...
</profiles>
...
And the glassfish-resources.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<custom-resource res-type="java.util.Properties" jndi-name="jndi/iprofile"
factory-class="org.glassfish.resources.custom.factory.PropertiesFactory">
<property name="name" value="${webapp.profile}" />
</custom-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/users" object-type="user" pool-name="MY-POOL">
<description/>
</jdbc-resource>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.microsoft.sqlserver.jdbc.SQLServerXADataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="MY-POOL" non-transactional-connections="false" ping="false" pool-resize-quantity="2" pooling="true" res-type="javax.sql.XADataSource" statement-cache-size="0" statement-leak-reclaim="false" statement-leak-timeout-in-seconds="0" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="serverName" value=""/>
<property name="PortNumber" value=""/>
<property name="DatabaseName" value=""/>
<property name="User" value=""/>
<property name="Password" value=""/>
</jdbc-connection-pool>
I want to set the DatabaseName property with the value Xpto defined in the pom. Other profiles have different values for the database.dbname property.