pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus KARG <markus@headcrashing.eu>
To: 'List' <pgsql-jdbc@postgresql.org>
Subject: Re: Migration to Maven
Date: Sun, 29 Nov 2015 09:56:45 +0100
Message-ID: <000a01d12a83$e0226d50$a06747f0$@eu> (raw)
In-Reply-To: <CAB=Je-ESMtmWxkTpzSufZp_TtrhiyJaE+HYhORSGFtdUM2gX4Q@mail.gmail.com>
References: <2138484843.20942254.1448530099460.JavaMail.zimbra@redhat.com>
	<2113338928.20942725.1448530160996.JavaMail.zimbra@redhat.com>
	<CADK3HHL5NDG65eVB6Ka5vnq4KdrJq7QPwwL9Gia83jiieCfbKA@mail.gmail.com>
	<CAE_9P=iEqvUbbuyedsSGVcFTxwgaSFz8Ux_qbn33Mk5E5tkrgw@mail.gmail.com>
	<565750BE.9090804@lawinegevaar.nl>
	<CADK3HHKzok6VrQZpxS=TLPqXEF=Reann07MVbtjLf-DM22v0tg@mail.gmail.com>
	<CAB=Je-GmOXZ0Y7pTg1hV0e9i+mhWucfj48utDQw-M3XETiC4SA@mail.gmail.com>
	<CAHpHs3muanx+0CQkg=fzdhRJ9zjmU=BwmpR9asgEy4eKT+WbCw@mail.gmail.com>
	<CADK3HHJC2r_sUoOpTTZ1NaY7pGL0Drw3qrWPB0qPrsbv1bocCw@mail.gmail.com>
	<CAHpHs3k71Esa2mnH2--YMyEpqq+k8jyo0RwER8-R=kC6iBvVTg@mail.gmail.com>
	<CAB=Je-GL5+LO9AkTZRVqNn-e7mbg+Y1gm4WGx53cskbY6UV8Aw@mail.gmail.com>
	<CAB=Je-ESMtmWxkTpzSufZp_TtrhiyJaE+HYhORSGFtdUM2gX4Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

I'm always a friend of clean and CoC-alike solutions. Hence I'd say it would be best to use the artifactId to indicate the difference between the JARs: A JDBC42 driver is definitively something different than a JDBC3 driver, so it would be wrong to use the same artifact name.

Anyways, my personal favorite is not liked by the project lead: Do not backport features into old PostgreSQL versions. That means, for each supported version of PostgreSQL there is one single branch, and that branch supports only the JDBC / JDK combination which was current at time of publication of the JDBC version. Into that branches, only backport fixes, which is simply using git. New features (and such, new JDBC / JDK combinations) on are added to that single JAR for the NEXT planned PostgreSQL version. This cuts away a lot of branches which nobody ever will need. PostgreSQL itself also does not add new technology to old versions, so why do we?

-Markus

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Vladimir Sitnikov
Sent: Samstag, 28. November 2015 22:01
To: Stephen Nelson; List
Subject: Re: [JDBC] Migration to Maven

The main problem with release is maven does not allow multiple deploys
to the same groupId:artifactId:version.

In other words:
1) build via jdk8, deploy -> ok, pom.xml, jdbc42.jar in maven
2) build via jdk7, deploy -> fail: "the same pom.xml already exists".

Well, that is exact problem predicted by Stephen, and I learned it the hard way.

I see two ways to workaround that.
I'm more inclined to "A": drop classifiers and put spec version to the
artifactId.
Any thoughts?

Frankly speaking I see absolutely no problems with having different
artifactIds for different jdbc versions provided github readme gives
<dependency> snippets for jdk6, 7, and 8.

A) Hidden maven submodules with jdbcspec (or jdk version) in
artifactId to provide jdk6&7 artifacts.

A1) mvn release:prepare release:perform via jdk8, deploy -> ok,
pom.xml, postgresql-9.4-1207.jar, postgresql-9.4-1207-sources.jar, etc
in maven. git tag is created for "non-snapshot" version.
A2) build & deploy "hidden" module. It will copy sources&tests from
the main one and build & deploy as usual. The only difference is
"hidden module" should use another maven coordinates. For instance
gorupId=org.postgresql, artifactId=postgresql-jdbc41

This seem to avoid usage of classifiers, and enables to have all three
jars present at the same time (mvn clean would clean just a submodule,
not all of them).

B) Use the same group&artifact and use classifiers to distinguish jdbc
spec versions. Custom-written "deploy-file" calls in profiles for old
JDBC spec versions can deploy additional files without clashing on
pom.xml.
Well, we could integrate custom deploy-file calls, but maven cannot
locate source.jar if custom classifiers are used (maven always
searches for ${artifact}-${version}-sources.jar).
That means we cannot have source.jar per jdbc spec, that is sad from
user-perspective.

B1) == A1, except classifiers are used.
B2) checkout non-snapshot tag, build only "core" project via jdk7. It
skips "default-deploy" and uses deploy-file tasks to deploy
jdbc41.jar, jdbc41-sources.jar, etc to maven.
B3) the same for jdk6
The trick is generatePom=false allows to deploy just a file without
overwriting pom.xml.
Final repository has all the jars under
org.postgresql:postgresql:9.4-1207 with different classifiers.

C) Branch per spec. Well, that seems to be harder to maintain as it
would require back-patching the same changes over and over.
It does not solve "same pom.xml" deployment problem, thus "branch per
spec" must be combined with A or B.

Vladimir


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (45+ messages)  latest in thread

Message-ID: <000a01d12a83$e0226d50$a06747f0$@eu>
Permalink:  ../000a01d12a83$e0226d50$a06747f0$@eu/
Also on:    postgresql.org/message-id/000a01d12a83$e0226d50$a06747f0$@eu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: markus@headcrashing.eu
  Subject: Re: Migration to Maven
  In-Reply-To: <000a01d12a83$e0226d50$a06747f0$@eu>
  References: <2138484843.20942254.1448530099460.JavaMail.zimbra@redhat.com> <2113338928.20942725.1448530160996.JavaMail.zimbra@redhat.com> <CADK3HHL5NDG65eVB6Ka5vnq4KdrJq7QPwwL9Gia83jiieCfbKA@mail.gmail.com> <CAE_9P=iEqvUbbuyedsSGVcFTxwgaSFz8Ux_qbn33Mk5E5tkrgw@mail.gmail.com> <565750BE.9090804@lawinegevaar.nl> <CADK3HHKzok6VrQZpxS=TLPqXEF=Reann07MVbtjLf-DM22v0tg@mail.gmail.com> <CAB=Je-GmOXZ0Y7pTg1hV0e9i+mhWucfj48utDQw-M3XETiC4SA@mail.gmail.com> <CAHpHs3muanx+0CQkg=fzdhRJ9zjmU=BwmpR9asgEy4eKT+WbCw@mail.gmail.com> <CADK3HHJC2r_sUoOpTTZ1NaY7pGL0Drw3qrWPB0qPrsbv1bocCw@mail.gmail.com> <CAHpHs3k71Esa2mnH2--YMyEpqq+k8jyo0RwER8-R=kC6iBvVTg@mail.gmail.com> <CAB=Je-GL5+LO9AkTZRVqNn-e7mbg+Y1gm4WGx53cskbY6UV8Aw@mail.gmail.com> <CAB=Je-ESMtmWxkTpzSufZp_TtrhiyJaE+HYhORSGFtdUM2gX4Q@mail.gmail.com> <000a01d12a83$e0226d50$a06747f0$@eu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox