[SPARK-34773][BUILD] change-scala-version.sh fails to modify pom.xml if it changes the version from 2.13 to 2.12 #31863
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.
What changes were proposed in this pull request?
This PR fixes an issue that If we change the Scala version to
2.13
and then change the version to2.12
usingchange-scala-version.sh
, it fails to modifypom.xml
and fails to build.The reason seems that the following logic never be able to fetch
2.12.0
frompom.xml
after it changes2.13.5
.Further, I don't think this logic and the following logic are necessary because those versions are changed by
-Pscala-2.13
if we'd like to build with Scala 2.13.So I removed them to fix this issue.
Why are the changes needed?
It's inconvenient if we'd like to change the version back to
2.12
in development.Does this PR introduce any user-facing change?
No.
How was this patch tested?
I confirmed build for Scala 2.13 and 2.12 successfully finishes with both sbt and Maven.
I also confirmed Scala 2.13.5 is used.