Re: PL/Java new build plugin

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Kartik Ohri <kartikohri13(at)gmail(dot)com>
Cc: pljava-dev(at)lists(dot)postgresql(dot)org
Subject: Re: PL/Java new build plugin
Date: 2020-07-02 16:24:45
Message-ID: 5EFE0A4D.8060402@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

On 07/02/20 00:15, Kartik Ohri wrote:
> I was reading about setting properties in MOJOs and found this detailed
> answer <https://stackoverflow.com/a/14727072/5557184>. I think this impacts
> how we utilise the plugin. Can you take a look?

That's a good find, and probably deserves a link on the wiki page, just
because I haven't ever found a better document for just laying out piece
by piece what will work and what won't.

It is clear why we can't use mojo-set properties in the activation of
profiles (profile activation happens too early), and I remember that
disappointed me greatly the first time I tried.

At present, the only ways we are using mojo-set properties are ways
that work, and provided we only change what mojo is setting them
(our own, vs. properties-maven-plugin reading them from a file), that
should not change.

We do, at present, have several Maven profiles in that POM that all
have to be activated different ways (command line, or system properties),
which has always been kind of inconvenient. In essence, we have been
using multiple profiles as a way to get nar-maven-plugin to apply the
right recipes for each platform.

Our own plugin should not need to be tweaked by profiles to do that;
it should natively have the notion of different recipes for different
platforms, and selecting the right one should be part of what it does.
(Of course nar-maven-plugin does have that notion natively also, it's
just that its built-in recipes aren't configurable enough for that to do
what we need.)

That should have a nice effect of shortening the POM too. The way the
Maven profile XML notation requires twenty-four lines to say "if it's
Mac OS, add --bundle_loader postgres" has never been a boon to readability.

That StackOverflow write-up does mention "properties injected into the
MavenSession"—rather than into any particular MavenProject—so that might
be a solid hint where we should set them.

Regards,
-Chap

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Kartik Ohri 2020-07-03 10:20:08 Re: PL/Java new build plugin
Previous Message Kartik Ohri 2020-07-02 04:15:11 Re: PL/Java new build plugin