<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay IDE 3.5 - External properties file gets overridden (wiped out)</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112417960" />
  <subtitle>Liferay IDE 3.5 - External properties file gets overridden (wiped out)</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112417960</id>
  <updated>2026-04-06T23:45:16Z</updated>
  <dc:date>2026-04-06T23:45:16Z</dc:date>
  <entry>
    <title>RE: Liferay IDE 3.5 - External properties file gets overridden (wiped out)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114572572" />
    <author>
      <name>Ashley Yuan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114572572</id>
    <updated>2019-08-02T06:52:13Z</updated>
    <published>2019-08-02T06:52:13Z</published>
    <summary type="html">Hello Gordon,&lt;br /&gt;&lt;br /&gt;Thanks for catching this problem. And thanks Andrew for prompt creating a ticket on issues.liferay.com.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve created &lt;a href="https://issues.liferay.com/browse/IDE-4652"&gt;a ticket&lt;/a&gt; which will be fixed in next release.</summary>
    <dc:creator>Ashley Yuan</dc:creator>
    <dc:date>2019-08-02T06:52:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay IDE 3.5 - External properties file gets overridden (wiped out)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114559388" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114559388</id>
    <updated>2019-08-01T14:31:25Z</updated>
    <published>2019-08-01T14:31:25Z</published>
    <summary type="html">Hey Gordon,&lt;br /&gt;&lt;br /&gt;If you have the time, would you mind opening a ticket at issues.liferay.com and then updating this thread with a link to it? That way if someone else comes alogn later, they can follow the trail and see the status of the issue (and any dialogue from the Liferay team). </summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-08-01T14:31:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay IDE 3.5 - External properties file gets overridden (wiped out)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114557068" />
    <author>
      <name>Gordon Augat</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114557068</id>
    <updated>2019-08-01T14:21:42Z</updated>
    <published>2019-08-01T14:21:42Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Cleaner code in the try catch block...&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;try &amp;amp;nbsp;{
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;props.load(externalPropertiesFile.getAbsolutePath());
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;props.setProperty("include-and-override", portalIdePropFile.getAbsolutePath());
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;props.setHeader("# Last modified by Liferay IDE (3.6.2-ga3) " + new Date());
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;props.save(externalPropertiesFile.getAbsolutePath());
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;retval = externalPropertiesFile;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;}
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;catch (Exception e) {
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;retval = null;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;}
&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Gordon Augat</dc:creator>
    <dc:date>2019-08-01T14:21:42Z</dc:date>
  </entry>
  <entry>
    <title>Liferay IDE 3.5 - External properties file gets overridden (wiped out)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112417959" />
    <author>
      <name>Gordon Augat</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112417959</id>
    <updated>2019-02-20T16:47:27Z</updated>
    <published>2019-02-20T16:47:27Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;When you specify an external properties file to use, the file gets completly overridden and you lose your custom settings.&amp;nbsp; The new external properties file just has the following...&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;# Last modified by Liferay IDE Wed Feb 20 09:38:31 MST 2019

include-and-override=[some location]\portal-ide.properties&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;I believe the problem is in the LiferayTomcatUtil.java class with the&amp;nbsp;_setupExternalPropertiesFile method. The current code wipes out my settings.&lt;br&gt;&lt;br&gt;Current code...&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;private static File _setupExternalPropertiesFile(File portalIdePropFile, String externalPropertiesPath) {
        File retval = null;

        File externalPropertiesFile = new File(externalPropertiesPath);

        if (FileUtil.exists(externalPropertiesFile)) {
            ExternalPropertiesConfiguration props = new ExternalPropertiesConfiguration();

            try (InputStream newInputStream = Files.newInputStream(externalPropertiesFile.toPath());
                OutputStream outputStream = Files.newOutputStream(externalPropertiesFile.toPath())) {

                props.load(newInputStream);
                props.setProperty("include-and-override", portalIdePropFile.getAbsolutePath());
                props.setHeader("# Last modified by Liferay IDE " + new Date());
                props.save(outputStream);

                retval = externalPropertiesFile;
            }
            catch (Exception e) {
                retval = null;
            }
        }
        else {
            retval = null;
        }

        return retval;
    }&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;When I revert the code back to the following, it works.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;private static File _setupExternalPropertiesFile(File portalIdePropFile, String externalPropertiesPath) {
        File retval = null;

        File externalPropertiesFile = new File(externalPropertiesPath);

        if (FileUtil.exists(externalPropertiesFile)) {
            ExternalPropertiesConfiguration props = new ExternalPropertiesConfiguration();

            try (InputStream newInputStream = Files.newInputStream(externalPropertiesFile.toPath())) {
                props.load(newInputStream);
                props.setProperty("include-and-override", portalIdePropFile.getAbsolutePath());
                props.setHeader("# Last modified by Liferay IDE " + new Date());
                props.save(Files.newOutputStream(externalPropertiesFile.toPath()));

                retval = externalPropertiesFile;
            }
            catch (Exception e) {
                retval = null;
            }
        }
        else {
            retval = null;
        }

        return retval;
    }&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Notice how the output stream is not created in the try statement as in the current code.&amp;nbsp; When it is created in the try statement, it does not work.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Gordon Augat</dc:creator>
    <dc:date>2019-02-20T16:47:27Z</dc:date>
  </entry>
</feed>
