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
There is no module-info.java #2657
Comments
Hi, Did previous versions contain a module-info descriptor ? |
I don't know but I guess not. I only referred to the latest version, because that was the one I downloaded today. |
Thanks for the report. Care to provide a PR ? |
what is a PR? |
Pull Request with changes to change the code so that it does what you want. |
It would be a two step job: I tried to do a build following the instructions on https://jdbc.postgresql.org/development/ Running ./gradlew build -DskipTests The module-info.java should probably look like this: ` module org.postgresql.jdbc {
}` I'm not very familiar with gradle, so you guys may be better at step 2. |
Are you sure that all above-cited dependencies need to be declared transitive? Generally a dependency should be transitive only if it appears in public API. For example if no public method from |
Probably not, I used jdeps to generate it and this is the result. |
If you compile with |
Did a test on a clone. This test requires an upgrade to Java 11 because I do not know how to create a multi-JAR file with Gradle. The following module org.postgresql.jdbc {
requires transitive java.sql;
requires transitive java.desktop; // Used for java.awt.Point only
requires transitive java.naming;
requires java.management;
requires java.security.jgss; // TODO: make transitive if org.postgresql.gss is exported
requires org.checkerframework.checker.qual;
exports org.postgresql;
exports org.postgresql.ds;
exports org.postgresql.core;
exports org.postgresql.util;
// TODO: what else to export?
provides java.sql.Driver with org.postgresql.Driver;
} The project depends on unnamed modules. So it requires the following option to be passed to
For avoiding above option, we should check if the dependencies providing the following packages have more recent releases as named modules:
Note also that the project has a dependency to the huge |
Deprecating setLocation along with an implementation of Point of our own. We really only have it there to set x and y |
Would making the dependency on |
@bowbahdoe I'm unsure what you are asking here ? |
Well, just looking at the module-info @desruisseaux posted, they have requires org.checkerframework.checker.qual; I'm questioning whether that is actually required - i.e. if someone depends on the maven artifact are they always going to get it - or if it is optional. The way you denote optional dependencies in module-infos is with requires static org.checkerframework.checker.qual; The only reason i question that one is I have a sense memory of that being an automatic module and its "just annotations" |
The project requires it to build, but it is not shipped in the jar. So users do not require it. |
Then it would be |
Verified that the removal of the Regarding the |
+1
The annotations need to be transitive since the users of pgjdbc.jar need to know which types are nullable and which are not. See #2053 (comment) |
Thanks for the link. So my understanding is that |
I think so. See |
Annotations with a retention of runtime are still safe to not include at runtime. getAnnotation and similar methods should just omit them. There are some asterisks, they just don't apply here best I can tell. |
@bowbahdoe , see #2053 |
@vlsi Guava is, best i can tell, planning to try. |
Bumping this, as I am writing a tiny app and got to the point where i figured "sqlite is less convenient than postgres" and I have to rewrite my build+deployment mechanism to use this. Which sucks. |
I no longer care about where checker qual is a static import since it has a proper module info typetools/checker-framework#6326 or at least will in an upcoming release. |
So can this be closed ? |
@davecramer No, you misunderstand. This artifact still needs a module-info.class. There was a separate conversation above this where what we were discussing was whether the dependency on the checker framework annotation jar should be However, the only reason to really care was that the checker framework annotation jar also didn't have a module-info. Now that it does or will, that concern is gone. I'll try to make a PR. Gradle is always a nightmare for me so hopefully I figure it out |
Look forward to your PR |
Going through the work now. This seems as if it will be dependent on
I'm gonna chip away at the waffle changes, see if thats easy enough to fix. |
The latest version as of the time of writing does not contain a module-info module descriptor, only an automatic module name listed in the manifest of the jar file.
This makes it impossible to link and pack a platform dependent artefact, because the jlink utility does not accept automatic modules.
A basic module-info.java can be generated using jdeps.
The text was updated successfully, but these errors were encountered: