Search code examples
liferayportal

How to stop overriding portal-ext file?


I have this issue which I am unable to fix. I have an ext-plugin which overrides my portal-ext.rpoperties file (and I don't want this overriding) with another blank portal-ext file. There is no portal-ext.properties file in my ext-plugin but still every time when I deploy, this happens.

Any kind of help would be appreciated.

Thanks.


Solution

  • This is the response which i got from Liferay support department and it solves my problem. I am sharing here so it could be helpful to any other.


    "Where is the portal-ext.properties file located in your system?

    In WEB-INF/classes or in ${liferay.home}/portal-ext.properties?"

    If it's in WEB-INF/classes, simply move your portal-ext.properties into ${liferay.home}/portal-ext.properties location. If it's the same, you can place your portal-ext.properties into your EXT plugin, so the original will be copied into the system instead of the empty one.

    You can also add include-and-override lines in the empty portal-ext.properties and rename your original file to be loaded after portal-ext.properties, or you can use different properties file and specify it to the JVM to load. See the relevant part from portal.properties file:

    Properties Override

    #
    # Specify where to get the overridden properties. Updates should not be made
    # on portal.properties or on portal-bundle.properties, but in
    # portal-ext.properties.
    #
    # The default read order is: portal.properties, portal-bundle.properties,
    # portal-ext.properties, and then portal-setup-wizard.properties.
    #
    include-and-override=portal-bundle.properties
    include-and-override=${liferay.home}/portal-bundle.properties
    include-and-override=portal-ext.properties
    include-and-override=${liferay.home}/portal-ext.properties
    include-and-override=portal-setup-wizard.properties
    include-and-override=${liferay.home}/portal-setup-wizard.properties
    
    #
    # Each portal instance can have its own overriden property file following
    # the convention portal-companyWebId.properties. To enable this feature, set
    # the "company-id-properties" system property to true.
    #
    # To enable:
    #
    #     java ... -Dcompany-id-properties=true
    #
    # The read order will now be: portal.properties, then portal-ext.properties,
    # and then portal-liferay.com.properties.
    #
    # Note that not all properties can have different values per company. This
    # functionality is only available for legacy reasons. The preferred way to
    # configure a portal instance is through the Control Panel.
    #
    include-and-override=portal-${easyconf:companyId}.properties
    include-and-override=${liferay.home}/portal-${easyconf:companyId}.properties
    
    #
    # Additional property files can be used by setting the "external-properties"
    # system property.
    #
    # A common use case is to keep legacy property values when upgrading to
    # newer versions of Liferay. To enable:
    #
    #     java ... -Dexternal-properties=portal-legacy-5.1.properties
    #
    # The read order will now be: portal.properties, then portal-ext.properties,
    # and then portal-legacy-5.1.properties.
    #
    include-and-override=${external-properties}
    include-and-override=${liferay.home}/${external-properties}