Early start on Maven plugin work

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: pljava-dev(at)lists(dot)postgresql(dot)org
Subject: Early start on Maven plugin work
Date: 2020-05-18 16:32:18
Message-ID: 5EC2B892.4060709@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Another message mostly for Kartik, anyone is welcome to comment.

Although it is phase 3 of the work, it is probably a good idea to fit in
a little bit of time early to get familiar with the implementation of
a Maven plugin.

In the project ideas, I was undecided whether to develop a plugin or
simply continue adding JavaScript to the build POMs. On further
reflection, looking at the number of distinct issues to be solved,
I am thinking the plugin is definitely preferable. The amount of
JavaScript to add to the POMs would otherwise greatly reduce their
readability to anyone who simply wanted to follow what the PL/Java
build is doing.

(This is not to say anything against JavaScript in the POMs for
quick testing of ideas.)

If you have not made a Maven plugin before, a good start might be
one that does something trivial, essentially hello, world for a plugin.

Perhaps add a new subproject (pljava-pgxs-maven?) whose product
is an org.postgresql pljava-pgxs-maven-plugin. For a start, the
plugin should have an Initialize phase, and do nothing but set
a Maven property pljava.pgxs to the value 1.

Then alter the POM in the pljava-so subproject to refer to that
plugin, and use the value of ${pljava.pgxs} somewhere, perhaps in
a <define> for the C compiler, so we can see the value set by the
plugin get compiled into C code.

Doing that much would confirm that we can successfully build a plugin
in one subproject, use it in another, and have it set Maven properties.
I think those would be good first steps.

If any of that turns out to be unexpectedly hard, finding out sooner
is better.

There might be existing examples to look at, but be aware of their
licensing terms; PostgreSQL and PL/Java are BSD-licensed, and it would
not be good to copy, or even appear to copy, any code that is not.

Regards,
-Chap

Browse pljava-dev by date

  From Date Subject
Next Message Chapman Flack 2020-05-19 02:09:30 Is anyone hacking on PL/Java using Eclipse ?
Previous Message Chapman Flack 2020-05-18 14:19:48 Re: Starting build-system work (Windows/Mac users please speak up)