Обсуждение: Postgresql-jdbc sources in maven central repository differ from the official ones

Поиск
Список
Период
Сортировка

Postgresql-jdbc sources in maven central repository differ from the official ones

От
Zuzana Miklankova
Дата:
Hello everyone,

I was in need to build a Postgresql-jdbc 42.2.14 from sources and got kind of stuck on the following issue:

Sources of Postgresql-jdbc 42.2.14 (officially available here[1]) are available also on the central maven repo as a tarball [2].

However, the contents of those two source tarballs differ in contained .java files.
The differences are in both "src/main/java/org/postgresql/" and  "src/test/java/org/postgresql/" directories.

An example of the difference is, e.g., the "src/main/java/org/postgresql/osgi" directory, which is not available in tarball located in the maven repository,
or the "src/test/java/org/postgresql/test/jdbc4/CopyUtfTest.java" file, which on the other hand is available only in the maven located tarball,
but there are more differences.

note: I observed this issue on version 42.2.14, but I did not examine any other versions in this matter.

Why does the content differ?
What steps does the proccess of publishing sources and jars to maven central repository consist of?

Any hint appreciated,
best regards,
Zuzana Miklankova.

Re: Postgresql-jdbc sources in maven central repository differ from the official ones

От
Vladimir Sitnikov
Дата:
Hi,

>I was in need to build a Postgresql-jdbc 42.2.14 from sources and got kind of stuck on the following issue:

The official way to build PostgreSQL JDBC driver is to use Gradle: 

If Gradle works for you, you could just stop here and you should ignore -src.tar.gz at Maven Central.

If Gradle does not work, I would suggest:
a) Configure Gradle at your machine somehow
b) If Gradle is absolutely not possible, then you could build with Maven,
and you should use -src.tar.gz convenience sources located at Maven Central.

-src.tar.gz has reduced features and reduced (!) test coverage,
so you need to be extra careful when you use pgjdbc that you build using Maven from -src.tar.gz.

We should probably move the description of -src.tar.gz to the website.

The official distribution should be compiled with Gradle.

>osgi" directory, which is not available in tarball located in the maven repository

This is expected (==reduced feature set)

>CopyUtfTest.java" file, which on the other hand is available only in the maven located tarball

This file probably existed in the filesystem when the release was prepared.
AFAIK CopyUtfTest.java does not exist in git.
I believe you could keep it or you could remove the test if it causes failures.

Vladimir

Re: Postgresql-jdbc sources in maven central repository differ from the official ones

От
Zuzana Miklankova
Дата:
This thread is golden, it explains everything I needed to know, thanks for sharing.

> We should probably move the description of -src.tar.gz to the website.

That could be really helpful for the future because I (as a newcomer) was trying to search all over, but it seems,
that this information about Maven build is available only in the above-mentioned thread
which I, unfortunately, did not manage to find.

>This file probably existed in the filesystem when the release was prepared.
>AFAIK CopyUtfTest.java does not exist in git.
>I believe you could keep it or you could remove the test if it causes failures.

I too did not find it in the git history, so this explains it.
The test fails (on missing some test file), so I will rather remove it.

With best regards,
Zuzana Miklankova


Re: Postgresql-jdbc sources in maven central repository differ from the official ones

От
Vladimir Sitnikov
Дата:
>That could be really helpful for the future 

Do you think you could suggest a PR? (e.g. docs/somewhere or contributing.md?)

There's also copr.fedorainfracloud.org build that you might find useful:

Vladimir

Re: Postgresql-jdbc sources in maven central repository differ from the official ones

От
Zuzana Miklankova
Дата:
>Do you think you could suggest a PR? (e.g. docs/somewhere or contributing.md?)

Yes, I can look further into this issue and write something.

Zuzana.

On Mon, Jan 10, 2022 at 9:12 AM Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>That could be really helpful for the future 

Do you think you could suggest a PR? (e.g. docs/somewhere or contributing.md?)

There's also copr.fedorainfracloud.org build that you might find useful:

Vladimir