Re: Maven Artifact JDK Suffix

From: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
To: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Cc: Mark Rotteveel <mark(at)lawinegevaar(dot)nl>, Dave Cramer <davecramer(at)gmail(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Maven Artifact JDK Suffix
Date: 2016-01-14 23:34:14
Message-ID: CAH7T-aoyGqjP+a-TdQRrgRUN8uo0O_z53LbukYujasW_V3YjAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, Jan 13, 2016 at 4:54 PM, Vladimir Sitnikov <
sitnikov(dot)vladimir(at)gmail(dot)com> wrote:

> >[2]: 9.4.1210.jre7 > 9.4.1207.jre8
>
> So what is the problem with that?
> I do not think there is a "proper" way to compare 1210.jre7 vs 1207.jre8.
> I do not think it outweights "multiartifact" drawbacks I list below.
>
> What I fear is java 10 when we would hit a string literal comparison wall.
> Thus we might want use jre07, jre08, jre09 to be prepared for jre10 :)
>

Well having separate artifacts obviates any issues with numeric string
compares :)

> > They're entirely different artifacts
>
> They are not.
> For instance: is it sane to include _both_ artifacts at the same time?
> I do not think so.
>

They are different artifacts but they provide a common dependency. I don't
think it'd be straightforward to add that concept into the way that Maven
works. Maybe if we had a separate "org.postgresql/postgresql" dependency
that contained only interfaces with the "org.postgresql/postgresql-jre8"
(and -jre7 or jre6) being marked as including it. That way a library that
is meant to be PG specific could specify an interface dependency on the
former but allow the user to specify the specific driver version they'd
like to use. Unfortunately that seems overly complicated ...

> Having different artifact ids would:
> 1) Open can of worms with "multiple pgjdbc artifacts at the same time".
> 2) Make upgrading pgjdbc very hard.
>

#1 is a valid point. If it's possible to have both defined in the same pom
then you could presumably end up with both on the classpath. Following up
on the overly complicated extra dependency idea I mentioned above, this
could be solved by having JRE specific naming of the implementation classes
(ex: org.postgresql.jre8.core). That way you can have multiple versions on
the classpath ... but again that's getting overly complicated.

I think the simplest solution is to just add the explicit jre8 suffix to
the JRE 8 version of the driver. Whether we also have an unsuffixed version
as a "latest" version is a separate debate (and my vote is leaning towards
a "no" on that).

Regards,
-- Sehrope Sarkuni
Founder & CEO | JackDB, Inc. | https://www.jackdb.com/

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Matthieu SANCHEZ 2016-01-15 10:18:36 Connection to PgSQL does not use SSL with JDBC driver 9.4 if the parameter is passed through Properties rather than URL
Previous Message Pavel Raiskup 2016-01-14 16:15:52 Re: [pgjdbc] Implement JDBC specs via pre-processor step (#435)