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 1jzOBy-0003Jo-KI for pljava-dev@arkaria.postgresql.org; Sat, 25 Jul 2020 17:42:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jzOBx-00076X-Jq for pljava-dev@arkaria.postgresql.org; Sat, 25 Jul 2020 17:42:37 +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 1jzOBx-00076L-4A for pljava-dev@lists.postgresql.org; Sat, 25 Jul 2020 17:42:37 +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 1jzOBu-0000Rc-KA for pljava-dev@lists.postgresql.org; Sat, 25 Jul 2020 17:42:36 +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=uzaSwPu02H07I2cT/06OC408JboQIyr4yncdfSuEtt0=; b=MIYGCgWwkTAiTcuM0PDE3IIgLB ygjp+0kX7En3sDqm2VKgdHd5iUu1veBcu23wL98OcOXqzQytoHFL5AHKvcJcg9pzpbBjtGv0R5E85 NaiclLGFnTipO2AAI1KZqRj85My29wUB/lJldfUOzSsWwDRD/V1OSdClMQZhmYvR+O23ZkY9AG2vb NLOd4HDovnw+1BlEQbkoQ3OoGVm5VcGnxZ3DegTl2+s32/MM1ChyABAoTu3FIoubXXNY2KenRYpZw seNOzSKfuSwZW5hfJAkzTAZxeK9IN1Y8ZCQCGIteTOc0Mmt7+jYnWWHyGF/gceSNy/DlpouNnvWEp tNr59MXg==; Received: from [184.19.31.139] (port=34705) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jzOBr-002K6W-7h; Sat, 25 Jul 2020 13:42:31 -0400 Subject: Re: PL/Java new build plugin To: Kartik Ohri References: <5F1664C5.2070700@anastigmatix.net> <5F1735ED.6020707@anastigmatix.net> <5F1753C9.4060500@anastigmatix.net> <5F175F40.1000905@anastigmatix.net> <5F18C58F.8060204@anastigmatix.net> <5F19C36C.70905@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5F1C6F06.2020809@anastigmatix.net> Date: Sat, 25 Jul 2020 13:42:30 -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/25/20 12:54, Kartik Ohri wrote: > I have been going through the maven javadoc plugin's source. It is huge and > is over 6000 lines. Thankfully, most of it is customization things we can > avoid. I saw that the current configuration for maven javadoc has > exclude parameters in the pom.xml file. Now, maven uses a DirectoryScanner > to help out with the excludes which is available as a package in maven > shared utils. I am unable to think of a way to handle excludes with the > inbuilt Java APIs. Should I utilise DirectoryScanner or do you have any > other suggestions? I honestly want something without any of that jazz at all. The bare javadoc tool does the right thing if run with defaults and pointed at the module descriptor. All the pain of 5ee9b6b and 395ac0d involved finding any possible way to prevent the maven-javadoc-plugin from making the javadoc tool do the wrong thing. Running the tool the right way shouldn't take more than 5 lines of JS. A MavenReport plugin will also need to send some information to the Doxia Sink to get the basic report page made with a link to the javadoc; that part might take more than 5 lines of script but I'd be surprised if more than 15. Literally, if a mojo implements MavenReport (or extends AbstractMavenReport) and makes the right objects available to the script engine, I don't think much else would be needed. I did some playing around with javax.script.Invocable (which the JS engines implement). You can define an interface with some instance methods, and ask the engine for an instance of it, and if the script defined the right functions, you get a usable-in-Java implementation of that interface, which works by calling the script functions. You can even define an interface that has some default methods, and it can be instantiated as long as the script defined the functions that are needed. If the script also defines a function corresponding to a default method, that gets used too. It works very much as one would guess. (I did a big double-take when I noticed you could have an interface with a default method, get an instance from the script engine, then eval another script that defines the missing function, and after that the Java instance you already had starts using the script function instead of the default!) That might be useful for this purpose, as a MavenReport has a bunch of methods (getName, getCategoryName, canGenerateReport, isExternalReport, etc.) that could be given reasonable defaults for most cases, but maybe a script should be able to override. MavenReport itself might not be the exact right interface to use (the mojo itself should implement that, or extend AbstractMavenReport), but maybe the mojo should declare a similar interface with a subset of those methods, and have that be what the script block should be able to supply). Regards, -Chap