Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jswIm-0006ua-FR for pljava-dev@arkaria.postgresql.org; Tue, 07 Jul 2020 22:43:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jswIk-0007Im-PR for pljava-dev@arkaria.postgresql.org; Tue, 07 Jul 2020 22:42:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jswIk-0007If-9m for pljava-dev@lists.postgresql.org; Tue, 07 Jul 2020 22:42:58 +0000 Received: from anastigmatix.net ([68.171.219.55]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jswIc-0008GS-D8 for pljava-dev@lists.postgresql.org; Tue, 07 Jul 2020 22:42:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hIUrMMM1UUiFxKjr0Hw4iRpFybt9xZG37TCW6MlwOHI=; b=QREcqRgf69Aw/B4ZiHK/7x60mv mh9DCSva+JHV1qa4/nME5mpmMlsJR/7Mvkudh0zrokmXCSUNU1PFXr+93d6hRuOq0VNIMve3LFd80 8l/6SOZerQyqlB0hJAim8RBx90pUIVdwmnWwaFjbZCP0JGPNVuwy2S7I8w3g89v0d4W4H9sg3brES r/Wr812EQwIp6SmerVT/29udqKjS11afHzsSB63ZiZOTCbkYLOf9yyCJbaQkbJrMQeDP0xkymHxrq lFNA7pMG0xeTAGyTQNuGQMEYWhAb6seJaFMNSFfsDXEqONYI1+o/SC8zllGEeFefpvURt91/cRFY8 9LDWaXgw==; Received: from [184.19.31.139] (port=48845) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jswIY-00AHmD-5v; Tue, 07 Jul 2020 18:42:46 -0400 Subject: Re: PL/Java new build plugin To: Kartik Ohri References: <5EFD41B1.30009@anastigmatix.net> <5EFE0A4D.8060402@anastigmatix.net> <5F0125BC.5000609@anastigmatix.net> <5F0172D7.3000708@anastigmatix.net> <5F02122C.7040905@anastigmatix.net> <5F021785.905@anastigmatix.net> <5F021A20.1050903@anastigmatix.net> <5F02340C.7030002@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5F04FA65.5000600@anastigmatix.net> Date: Tue, 7 Jul 2020 18:42:45 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/07/20 09:58, Kartik Ohri wrote: > pgsql.properties has paths of the type C\:/PROGRA~1/POSTGR~1/12/bin while > the our plugin has paths of type C:/PROGRA~1/POSTGR~1/12/bin. I can > probably fix this by detecting the OS and doing a string substitution I'm not sure that's really a Windows-specific behavior, just an overcautious \ added before the : when the property is written to the file. If you were using java.util.Properties and the store() method to write the file, you also would have the \ there: jshell> var p = new Properties() jshell> p.put("mypath", "C:/PROGRA~1/POSTGR~1/12/bin") jshell> p.store(System.out, "I am a comment") #I am a comment #Tue Jul 07 18:32:12 EDT 2020 mypath=C\:/PROGRA~1/POSTGR~1/12/bin The backslash isn't actually necessary before a colon as part of the value. (If a colon were part of the /key/, the backslash would be needed.) A Properties object can happily read in the same value with or without the backslash there: jshell> p.clear() jshell> p.load(new StringReader(""" ...> #Tue Jul 07 18:32:12 EDT 2020 ...> mypath=C:/PROGRA~1/POSTGR~1/12/bin ...> """)) jshell> p.get("mypath") $12 ==> "C:/PROGRA~1/POSTGR~1/12/bin" So that backslash isn't really essential there, it is just something Properties.store() happens to add when writing a file. So I have to assume that whatever isn't working on Windows must have some other cause really. It might not be worth spending much time on backslash or no backslash in the file, as I assume eventually you will write no file at all, and just set the properties in Maven directly. I added some additional code comments in github: https://github.com/amCap1712/pljava/commit/f3dd925 Regards, -Chap