Re: Migration to Maven - Mailing list pgsql-jdbc

From Markus KARG
Subject Re: Migration to Maven
Date
Msg-id 000a01d12a83$e0226d50$a06747f0$@eu
Whole thread Raw
In response to Re: Migration to Maven  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Responses Re: Migration to Maven  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-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
thedifference between the JARs: A JDBC42 driver is definitively something different than a JDBC3 driver, so it would be
wrongto use the same artifact name. 

Anyways, my personal favorite is not liked by the project lead: Do not backport features into old PostgreSQL versions.
Thatmeans, 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,
whichis simply using git. New features (and such, new JDBC / JDK combinations) on are added to that single JAR for the
NEXTplanned PostgreSQL version. This cuts away a lot of branches which nobody ever will need. PostgreSQL itself also
doesnot 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



pgsql-jdbc by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: Migration to Maven
Next
From: Dave Cramer
Date:
Subject: Re: Migration to Maven