apache / apache/iceberg

Exclude JUnit4 dependency from classpath

Open
#13,049 1 comment 0 reactions 0 assignees View on GitHub
improvement not-stale
Dominant language
Java
Stars
9.2k
Forks
3.5k
Avg merge
2d 11h
Merged PRs (30d)
132

Description

### Feature Request / Improvement

We should apply the diff
```
diff --git a/build.gradle b/build.gradle
index cd79e45a7f..ed7133cc7e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -182,6 +182,7 @@ subprojects {
exclude group: 'com.sun.jersey'
exclude group: 'com.sun.jersey.contribs'
exclude group: 'org.pentaho', module: 'pentaho-aggdesigner-algorithm'
+ exclude group: 'junit'
}
```

to completely exclude JUnit4 from the classpath.

There are unfortunately still a few other projects that depend on JUnit4
* Testcontainers depends on JUnit4 when using `GenericContainer`. As indicated by https://github.com/testcontainers/testcontainers-java/issues/970 this should be fixed in Testcontainers 2.0
* Flink currently also depends on JUnit4 as indicated in https://github.com/apache/iceberg/issues/12937 (Flink's `InternalMiniClusterExtension` still depends on having JUnit4 on the classpath)

### Query engine

None

### Willingness to contribute

- [ ] I can contribute this improvement/feature independently
- [ ] I would be willing to contribute this improvement/feature with guidance from the Iceberg community
- [ ] I cannot contribute this improvement/feature at this time

Contributor guide

Open the contributing guide

Research direction

Start in build.gradle at the subprojects dependency exclusions and review the linked Testcontainers and Flink constraints. Apply the requested JUnit4 exclusion and verify that dependency resolution no longer places JUnit4 on the classpath without breaking the affected projects.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.