Skip to content

Fix: Remove excluded modules from classpath#142

Merged
tgodzik merged 1 commit intoscalacenter:mainfrom
dwijrajhari:dwij/fix-exclusion
Apr 7, 2026
Merged

Fix: Remove excluded modules from classpath#142
tgodzik merged 1 commit intoscalacenter:mainfrom
dwijrajhari:dwij/fix-exclusion

Conversation

@dwijrajhari
Copy link
Copy Markdown
Contributor

@dwijrajhari dwijrajhari commented Apr 7, 2026

Problem (#141)

When a Maven module declares an <exclusion> on a transitive dependency, the excluded module's compiled output directory still appears on the Bloop classpath. This causes compilation failures in projects that use exclusions to manage classpath conflicts. This problem is reproducible in Spark (See #141 for details)

Solution

MavenProject.getArtifacts() returns the set of artifacts that survived Maven's full dependency resolution, including exclusion filtering. This PR uses this method as a gate before adding modules to the classpath.

Test plan

  • Added integration test
  • Validated the fix against Spark
$ mvn generate-sources ch.epfl.scala:bloop-maven-plugin:2.0.2-SNAPSHOT:bloopInstall
$ bloop compile spark-catalyst_2.13
Compiling spark-catalyst_2.13 (655 Scala sources and 237 Java sources)
...
...
Compiled spark-catalyst_2.13 (18776ms)

closes #141

cc: @tgodzik

Copy link
Copy Markdown
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgodzik tgodzik merged commit 7adc094 into scalacenter:main Apr 7, 2026
4 checks passed
@dwijrajhari dwijrajhari deleted the dwij/fix-exclusion branch April 7, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<exclusion> on transitive dependencies not respected in Bloop classpath

2 participants