Re: Maven Artifact JDK Suffix - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: Maven Artifact JDK Suffix
Date
Msg-id CADK3HH+wBDWJB8=fGD_OuQOaTN0RPugL53Ym8-4pA+Sbb3gUXw@mail.gmail.com
Whole thread Raw
In response to Re: Maven Artifact JDK Suffix  (Sehrope Sarkuni <sehrope@jackdb.com>)
Responses Re: Maven Artifact JDK Suffix
List pgsql-jdbc

On 14 January 2016 at 18:34, Sehrope Sarkuni <sehrope@jackdb.com> wrote:
On Wed, Jan 13, 2016 at 4:54 PM, Vladimir Sitnikov <sitnikov.vladimir@gmail.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).


I would have to agree with this. I think people will be surprised (not in a good way) if we upgrade to java 9 and all of a sudden maven pulls down JDBC for java 9

Dave

pgsql-jdbc by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: Connection to PgSQL does not use SSL with JDBC driver 9.4 if the parameter is passed through Properties rather than URL
Next
From: Mark Rotteveel
Date:
Subject: Re: Maven Artifact JDK Suffix