Fix: Correctly detect Scala version defined in maven-scala-plugin configuration#134
Merged
tgodzik merged 1 commit intoJan 19, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes a bug where the bloop-maven-plugin failed to detect the Scala version when it was defined within an <execution> block of the scala-maven-plugin configuration, rather than at the plugin level.
Changes:
- Updated
MojoImplementation.scalato inspect and merge both execution-level and plugin-level configurations when detecting Scala settings - Added regression test
issue84to verify the fix works correctly for the reported scenario - Added test resource
issue_84/pom.xmlthat reproduces the original issue
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/scala/bloop/integrations/maven/MojoImplementation.scala | Modified configuration extraction logic to merge execution and plugin configurations, ensuring execution-level settings take precedence |
| src/test/scala/bloop/integrations/maven/MavenConfigGenerationTest.scala | Added test case to verify Scala version is correctly detected from execution configuration |
| src/test/resources/issue_84/pom.xml | Added test project with Scala version defined only in execution block to reproduce the reported issue |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
hey @tgodzik any updates on this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
The
bloop-maven-pluginfailed to detectscalaVersionorscalaCompatVersionif these were defined within an<execution>block of thescala-maven-plugin(a common configuration pattern), causing it to fall back to the Scala version of the project's dependencies (e.g., sticking to 3.2.2 even if 3.4.2 was configured).Solution:
Updated MojoImplementation.scala to inspect not only the top-level plugin configuration but also all
<execution>configurations. These configurations are merged (Execution config > Plugin config) to ensure the specific execution settings are respected.Verification:
Added a regression test
issue84in MavenConfigGenerationTest.scala which reproduces the issue using a test project (issue_84/pom.xml) that defines the Scala version only in an execution block. The test passes and confirms the correct version (3.4.2) is detected.Fixing issue:
fixes #84
@tgodzik