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 1jpHs1-0000qz-Va for pljava-dev@arkaria.postgresql.org; Sat, 27 Jun 2020 20:56:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jpHs0-00073b-6Y for pljava-dev@arkaria.postgresql.org; Sat, 27 Jun 2020 20:56:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpHrz-00072v-NH for pljava-dev@lists.postgresql.org; Sat, 27 Jun 2020 20:56:16 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpHrt-0004iz-6L for pljava-dev@lists.postgresql.org; Sat, 27 Jun 2020 20:56:14 +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:References:To:Subject:Sender: Reply-To:Cc: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=ChPGW18EcdTM9qSf4V39KnkNm2Bb22mSzXydkrV8LDk=; b=Tbn32ExhuCI65ZgWIVgPFOY1gk r7FK3r/7p+l+KK/3JyoiCgkNUDa0BWfTpCS9DBLgBlXZlHoIm4SlMliUJoakErERhrX6b9JgJL02/ E0Mp+PktccYKjDaXqJ/FaPDH6A1qXjzJ6VPXe7qbw4BzuTxAut64A58vLblKYdTJAUE3JCESGGlr4 dQXWIR/Q+3zwohIVYQWdCmAgGBdpdTX9+GgH9uaqChDoKbg/FoVGZF5V/lLJ63psyQZU/oGQuBeKt K9bSQDYKz8+XLiD83I2pX60When05Zm7hoHeZIHWUG1vJ2x09U4CTE6zD2UA71em+suzfz/wHAnTD jL+3aPpQ==; Received: from [184.19.31.139] (port=56086) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jpHrq-008klZ-8S; Sat, 27 Jun 2020 16:56:07 -0400 Subject: Re: PL/Java new build plugin To: Kartik Ohri , pljava-dev@lists.postgresql.org References: From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5EF7B265.3060907@anastigmatix.net> Date: Sat, 27 Jun 2020 16:56:05 -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 Hi! On 06/26/20 16:33, Kartik Ohri wrote: > Hi! I built a Hello, World! plugin and it seems that the build process will > need to be a two step one. I am not completely sure about this though. I > needed to run mvn clean install the first time I added the plugin module > before I could execute the Mojo. Oddly, that doesn't seem to be a problem when I try it here. Just for grins, I added these lines in pljava-so/pom.xml: org.postgresql pljava.pgxs 0.0.1-SNAPSHOT count and ran an ordinary mvn clean install, and Maven (3.5.2) correctly figured out it had better build pljava.pgxs before pljava-so, and it all went smoothly in one run: [INFO] Reactor Build Order: [INFO] [INFO] PostgreSQL PL/Java [INFO] PL/Java API [INFO] PL/Java backend Java code [INFO] pljava.pgxs Maven Plugin [INFO] PL/Java backend native code [INFO] PL/Java Ant tasks [INFO] PL/Java examples [INFO] PL/Java packaging ... [INFO] Building pljava.pgxs Maven Plugin 0.0.1-SNAPSHOT ... [INFO] Building PL/Java backend native code 1.6.0-SNAPSHOT ... [INFO] --- pljava.pgxs:0.0.1-SNAPSHOT:count (default) @ pljava-so --- [INFO] Number of modules0 ... [INFO] Reactor Summary: [INFO] [INFO] PostgreSQL PL/Java ................................. SUCCESS [INFO] PL/Java API ........................................ SUCCESS [INFO] PL/Java backend Java code .......................... SUCCESS [INFO] pljava.pgxs Maven Plugin ........................... SUCCESS [INFO] PL/Java backend native code ........................ SUCCESS [INFO] PL/Java Ant tasks .................................. SUCCESS [INFO] PL/Java examples ................................... SUCCESS [INFO] PL/Java packaging .................................. SUCCESS [INFO] [INFO] BUILD SUCCESS I am glad I tried it, because I was feeling pretty sour about the idea of a two-step build. :) Were you using an earlier Maven version? I wonder if that might be part of the story if it wouldn't build for you in one step. (I noticed a maven.version 3.3.9 in your new pom). It's ok to assume Maven 3.5.2 as the minimum; that already became necessary in PR #268 [1]. I notice it gives the count of modules as zero, so I guess something about the parameter injection didn't go right, but everything else seemed to. It's possible it gets *its own MavenProject* injected, which doesn't have any modules, and it might be interesting to follow the project's parent link (assuming there is one) and count those modules instead. A few comments: - the commit diff makes it look as if the entire top pom.xml has been deleted and replaced [2]. I suspect that means you edited the file with some tool that both changed the indenting, and made the lines double-spaced. A commit like that is hard to review, and it interferes with git tools for exploring the origins and history of changes. It's important to check that a git diff is able to show just the specific changes you intended to make in a given commit. - PL/Java uses the same source code format conventions as PostgreSQL, described in [3]. That will call for changing the indenting in the added pom.xml and HelloWorldMojo.java file, and maybe a few other details like placement of { and }. - Java source files all (should) have the project's current comment header at the top (with your name as contributor, of course). Some of the older files have an older version that hasn't been updated yet, but any of the recently touched ones should have the right one (the one that refers to BSD 3-Clause). - All the other subproject IDs are pljava-something, not pljava.something. Congratulations, it seems to be a working plugin! Regards, -Chap [1] https://github.com/tada/pljava/commit/bfbe4c2 [2] https://github.com/amCap1712/pljava/commit/39596cf#diff-600376dffeb79835ede4a0b285078036 [3] https://www.postgresql.org/docs/12/source-format.html