Subject: [pgjdbc/pgjdbc] issue #3480: 42.7.5 breaks RHEL 8 builds

From: "devrimgunduz (@devrimgunduz)" <[email-masked]>
Date: Tue, 14 Jan 2025 23:08:55 +0000

Hi,

RHEL 8 builds are broken with the 42.7.5 because of the mininum maven requirement:

`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.6.0:shade (default) on project postgresql: The plugin org.apache.maven.plugins:maven-shade-plugin:3.6.0 requires Maven version 3.6.3 -> [Help 1]
`

RHEL 8 is still widely used and it ships with maven 3.5.4. Any chance to relax this dependency?

Thanks!

Regards, Devrim

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 15 Jan 2025 11:07:46 +0000

@jorsol can we accomodate this request ? https://github.com/pgjdbc/pgjdbc/commit/f2f3d68cddbae5aaafcb1681787f62d3ae61def7#diff-b309a59a5808c3a026a56139c59abee637fd693d73e392c3ff9a2a1e05572498
@devrimgunduz can you just change the version of the shade plugin when you build ?

---

From: "jorsol (@jorsol)" <[email-masked]>
Date: Wed, 15 Jan 2025 12:17:08 +0000

Yes, it could be downgraded to `3.5.1`, this could also be done when building the rpm package, the red hat folks even removed the plugin since they don't allow shaded dependencies: https://src.fedoraproject.org/rpms/postgresql-jdbc/blob/rawhide/f/postgresql-jdbc.spec#_98

A similar approach can be done on the spec used of PGDG, by simply downgrading the version to 3.5.1 of the shade plugin and it should build on Maven 3.5.4.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 15 Jan 2025 12:20:42 +0000

@devrimgunduz I feel like we should have a test for your builds in our CI pipeline ?

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Wed, 15 Jan 2025 12:26:42 +0000

It seems like the recent release builds with Copr somehow:
* https://github.com/pgjdbc/pgjdbc/actions/runs/12775033160/job/35610465749
* https://copr.fedorainfracloud.org/coprs/g/pgjdbc/pgjdbc/build/8513341/
* https://download.copr.fedorainfracloud.org/results/@pgjdbc/pgjdbc/fedora-rawhide-x86_64/08513341-postgresql-jdbc/builder-live.log.gz => `+ /usr/bin/python3 /usr/share/java-utils/pom_editor.py pom_xpath_remove 'pom:plugin[pom:artifactId = '\''maven-shade-plugin'\'']'`

See https://github.com/pgjdbc/pgjdbc/blob/032d0e225a91e866d7dae680ebb784507392e803/packaging/rpm/postgresql-jdbc.spec.tpl#L107

In other words, for rpm-like builds we expect to remove shading plugin altogether.
However, the released `pom.xml` can produce both shaded and non-shaded dependencies.

So you could either cut out `maven-shade-plugin` (see `postgresql-jdbc.spec.tpl`) or use `mvn -DskipShadeDependencies=true ....` to avoid shading altogether (see https://github.com/pgjdbc/pgjdbc/blob/032d0e225a91e866d7dae680ebb784507392e803/pgjdbc/reduced-pom.xml#L207C65-L207C93)

---

From: "devrimgunduz (@devrimgunduz)" <[email-masked]>
Date: Wed, 15 Jan 2025 16:40:38 +0000

Really appreciated! Removed that plugin and builds work fine. Thanks.

---

From: "jorsol (@jorsol)" <[email-masked]>
Date: Wed, 15 Jan 2025 17:02:34 +0000

@devrimgunduz keep in mind that if you don't shade the dependencies, you also need to package the dependencies used for scram authentication, or there will be lots of complains that scram authentication does not work.

So you can remove the plugin and package the scram/stringprep dependencies, or just simply downgrade the version to 3.5.1 and keep using the shaded version.

---

From: "devrimgunduz (@devrimgunduz)" <[email-masked]>
Date: Wed, 15 Jan 2025 18:08:14 +0000

Thank you! Pushed the driver with downgrading shade plugin to 3.5.1