Subject: [pgjdbc/pgjdbc] issue #3787: junit scope in *pom.xml

From: "Dmole (@Dmole)" <[email-masked]>
Date: Thu, 04 Sep 2025 14:15:08 +0000

**Describe the issue**

The ~/.m2 file

org/postgresql/postgresql/42.7.7/postgresql-42.7.7.pom

seems to be most closely related to 

https://github.com/pgjdbc/pgjdbc/blob/release/42.7.x/pgjdbc/reduced-pom.xml

but the former has

```
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.12.2</version>
      <scope>runtime</scope>
      <optional>true</optional>
    </dependency>
```

and the later has

```
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>%{org.junit.jupiter:junit-jupiter-params}</version>
            <scope>test</scope>
        </dependency>
```

**Driver Version?** 

42.7.7

**To Reproduce**

Include pgjdbc in maven 

**Expected behaviour**

junit* have scope test

**Actual behaviour**

junit* has scope runtime

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Thu, 04 Sep 2025 15:00:17 +0000

Please provide a PR

---

From: "Dmole (@Dmole)" <[email-masked]>
Date: Thu, 04 Sep 2025 19:18:34 +0000

https://github.com/pgjdbc/pgjdbc/blob/master/build-logic/publishing/src/main/kotlin/build-logic.publish-to-central.gradle.kts#L174

appears to create postgresql-42.7.7.pom from pom-default.xml but pom-default.xml is not referenced anywhere else. Additionally the pom made by gradlew generatePomFileForPostgresqlPublication differs from what is on the maven repository 

```
grep -c \<dependency ./pgjdbc/build/local-maven-repo/org/postgresql/postgresql/42.7.7-SNAPSHOT/postgresql-42.7.7-20250904.185040-1.pom
2
grep -c \<dependency  ~/.m2/repository/org/postgresql/postgresql/42.7.7/postgresql-42.7.7.pom
5
```

Tracing the execution flow through the gradle is non-trivial:

```
./gradlew --debug generatePomFileForPostgresqlPublication | wc -l
66,148

```

@davecramer perhaps someone who is familiar with the project could indicate the source of the discrepancies.