[jboss-jira] [JBoss JIRA] (WFLY-13674) WARN if deployment descriptor has ${...} but *property-replacement=false

Brad Maxwell (Jira) issues at jboss.org
Thu Jul 16 17:44:00 EDT 2020


Brad Maxwell created WFLY-13674:
-----------------------------------

             Summary: WARN if deployment descriptor has ${...} but *property-replacement=false
                 Key: WFLY-13674
                 URL: https://issues.redhat.com/browse/WFLY-13674
             Project: WildFly
          Issue Type: Enhancement
          Components: EE
    Affects Versions: 20.0.0.Final
            Reporter: Brad Maxwell
            Assignee: Brian Stansberry


WARN if deployment descriptor has ${...} but *property-replacement=false

By default the property replacement defaults to true for jboss deployment descriptors and false for annotations and spec deployment descriptors:

 
{code:java}
        "annotation-property-replacement" => false,
        "jboss-descriptor-property-replacement" => true,
        "spec-descriptor-property-replacement" => false, {code}
 

In the persistence.xml for example, there is a freeform <properties> with properties that can change over time and default values.  If *property-replacement is false , then ${...} is passed to the DUP to configure and can cause problems such as in this hibernate property which changed from default value of false to true and the user was unaware that system property substitution was not occurring because they had not enabled it.

 
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1"
    xmlns="http://xmlns.jcp.org/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
  <persistence-unit name=“example” transaction-type="JTA">
    <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
    <properties>
      <property name="hibernate.cache.use_second_level_cache" value="${hibernate_cache.enabled:false}" />
    </properties>
  </persistence-unit>
</persistence> {code}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the jboss-jira mailing list