Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgjdbc-ng missing module-info #464

Closed
lanthale opened this issue Nov 30, 2019 · 5 comments · May be fixed by #553
Closed

pgjdbc-ng missing module-info #464

lanthale opened this issue Nov 30, 2019 · 5 comments · May be fixed by #553

Comments

@lanthale
Copy link

lanthale commented Nov 30, 2019

First thank you for all the effort regarding this driver. It is so much better than the standard jdbc driver and the speed and stability is much better.

The only thing which is missing is a multi-release jar with all dependencies included so that desktop/mobile applications which must to use jlink for distribution can use the driver as well.

I had the following situation where a module-info inside of pgjdbc-ng would saved me alot of time:
The task was to migrate an application from Javafx8 to Javafx11 including to change the JDK to 11 as well. For that I have to use jlink because the tool jpackager can only work with a jlink image. In order to get a jlink image I have to create for every library which is not modularized a module-info.java.

For pgjdbc-ng driver which is using netty, this was very difficult because all netty libs are not modularized yet.

Here is the maven code and org.moditect (maven module to create module-info files) config to get a working pgjdbc-ng module. This was a very complicated task from my perspective and I hope you can either add this to the wiki or create a multi-release jar with all dependency's.

Here is the maven code to get the lib (sorry for bad format):

<dependency>
            <groupId>com.impossibl.pgjdbc-ng</groupId>
            <artifactId>pgjdbc-ng</artifactId>
            <version>0.8.3</version>
            <classifier>all</classifier>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions> 
</dependency>

<module>
                                    <artifact>
                                        <groupId>com.impossibl.pgjdbc-ng</groupId>
                                        <artifactId>pgjdbc-ng</artifactId>
                                        <classifier>all</classifier>
                                    </artifact>                                    
                                    <moduleInfoSource>
                                        open module pgjdbc.ng {
                                                                                
                                        requires java.logging;
                                        requires java.naming;
                                        requires java.sql;
                                        requires java.transaction.xa;
                                        requires java.xml;
                                        requires jdk.unsupported;
                                        
                                        uses com.impossibl.postgres.system.procs.ProcProvider;

                                        exports com.impossibl.postgres.api.data;
                                        exports com.impossibl.postgres.api.jdbc;
                                        exports com.impossibl.postgres.datetime;
                                        exports com.impossibl.postgres.jdbc;
                                        exports com.impossibl.postgres.jdbc.xa;
                                        exports com.impossibl.postgres.protocol;
                                        exports com.impossibl.postgres.protocol.ssl;
                                        exports com.impossibl.postgres.protocol.v30;
                                        exports com.impossibl.postgres.system;
                                        exports com.impossibl.postgres.system.procs;
                                        exports com.impossibl.postgres.system.tables;
                                        exports com.impossibl.postgres.types;
                                        exports com.impossibl.postgres.utils;
                                        exports com.impossibl.postgres.utils.guava;

                                        provides com.impossibl.postgres.system.procs.ProcProvider with
                                        com.impossibl.postgres.system.procs.ACLItems,
                                        com.impossibl.postgres.system.procs.Arrays,
                                        com.impossibl.postgres.system.procs.BitMods,
                                        com.impossibl.postgres.system.procs.Bits,
                                        com.impossibl.postgres.system.procs.Bools,
                                        com.impossibl.postgres.system.procs.Boxes,
                                        com.impossibl.postgres.system.procs.Bytes,
                                        com.impossibl.postgres.system.procs.Cidrs,
                                        com.impossibl.postgres.system.procs.Circles,
                                        com.impossibl.postgres.system.procs.Dates,
                                        com.impossibl.postgres.system.procs.Domains,
                                        com.impossibl.postgres.system.procs.Float4s,
                                        com.impossibl.postgres.system.procs.Float8s,
                                        com.impossibl.postgres.system.procs.HStores,
                                        com.impossibl.postgres.system.procs.Inets,
                                        com.impossibl.postgres.system.procs.Int2s,
                                        com.impossibl.postgres.system.procs.Int2Vectors,
                                        com.impossibl.postgres.system.procs.Int4s,
                                        com.impossibl.postgres.system.procs.Int8s,
                                        com.impossibl.postgres.system.procs.Intervals,
                                        com.impossibl.postgres.system.procs.Jsons,
                                        com.impossibl.postgres.system.procs.Lines,
                                        com.impossibl.postgres.system.procs.LSegs,
                                        com.impossibl.postgres.system.procs.MacAddrs,
                                        com.impossibl.postgres.system.procs.MacAddr8s,
                                        com.impossibl.postgres.system.procs.Moneys,
                                        com.impossibl.postgres.system.procs.Names,
                                        com.impossibl.postgres.system.procs.NumericMods,
                                        com.impossibl.postgres.system.procs.Numerics,
                                        com.impossibl.postgres.system.procs.Oids,
                                        com.impossibl.postgres.system.procs.OidVectors,
                                        com.impossibl.postgres.system.procs.Paths,
                                        com.impossibl.postgres.system.procs.Points,
                                        com.impossibl.postgres.system.procs.Polygons,
                                        com.impossibl.postgres.system.procs.Ranges,
                                        com.impossibl.postgres.system.procs.Records,
                                        com.impossibl.postgres.system.procs.Strings,
                                        com.impossibl.postgres.system.procs.Tids,
                                        com.impossibl.postgres.system.procs.TimeMods,
                                        com.impossibl.postgres.system.procs.TimestampMods,
                                        com.impossibl.postgres.system.procs.TimestampsWithoutTZ,
                                        com.impossibl.postgres.system.procs.TimestampsWithTZ,
                                        com.impossibl.postgres.system.procs.TimesWithoutTZ,
                                        com.impossibl.postgres.system.procs.TimesWithTZ,
                                        com.impossibl.postgres.system.procs.UUIDs,
                                        com.impossibl.postgres.system.procs.XMLs;
                                        provides java.sql.Driver with
                                        com.impossibl.postgres.jdbc.PGDriver;
                                        }
                                    </moduleInfoSource>
</module>
@kdubb kdubb self-assigned this Dec 2, 2019
@kdubb kdubb changed the title pgjdbc-ng missing module-info for java 11+ applications pgjdbc-ng missing module-info Dec 2, 2019
@kdubb kdubb added this to the 0.9 Packaging & Performance milestone Dec 2, 2019
@kdubb
Copy link
Member

kdubb commented Dec 2, 2019

This is Java 9+ related and should be easy to add unless it creates issues with Java 8.

@A248
Copy link

A248 commented Jun 30, 2021

@kdubb Is this something you would be willing to accept contributors for?

@kdubb
Copy link
Member

kdubb commented Jun 30, 2021

Absolutely!

@lanthale
Copy link
Author

lanthale commented Jul 1, 2021

Perfect. I am looking forward to see the changes in 0.9 to get a good JDK 9+ developer experience.

@lanthale lanthale closed this as completed Jul 1, 2021
@A248
Copy link

A248 commented Jul 7, 2021

@kdubb I've some questions for you regarding implementing this. Normally, a module only exposes the packages which are part of its public API. I've inferred that you likely don't consider the entirety of the driver public API, as I've seen a few breaking changes in public interfaces, interfaces which surely seem specific to the implementation.

The api.data, api.jdbc, jdbc, and jdbc.xa packages seem to comprise the driver's public API. Is this correct, or do you intend to expose all the other packages in the API?

(One of the advantages of a module descriptor is that, once codified, the set of exposed packages will be clearly defined, and you won't have questions like this one.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants