@@ -5,24 +5,40 @@ Dependency Management
55
66.. include:: /includes/scala-java-dependencies.rst
77
8- The following excerpt is from a Maven ``pom.xml`` file:
8+ Beginning in version 3.2.0, Apache Spark supports both Scala {+scala-previous+} and {+scala-latest+}.
9+ Spark 3.1.3 and previous versions support only Scala {+scala-previous+}.
10+ To provide support for both Scala versions, version {+current-version+} of the Spark
11+ Connector produces two artifacts:
12+
13+ - ``org.mongodb.spark:mongo-spark-connector_{+scala-previous+}:{+current-version+}`` is
14+ compiled against Scala {+scala-previous+}, and supports Spark 3.1.x and above.
15+ - ``org.mongodb.spark:mongo-spark-connector_{+scala-latest+}:{+current-version+}`` is
16+ compiled against Scala {+scala-latest+}, and supports Spark 3.2.x and above.
17+
18+ .. important::
19+
20+ Use the Spark Connector artifact that's compatible with your
21+ versions of Scala and Spark.
22+
23+ The following excerpt from a Maven ``pom.xml`` file shows how to include dependencies
24+ compatible with Scala {+scala-previous+}:
925
1026.. code-block:: xml
1127
1228 <dependencies>
1329 <dependency>
1430 <groupId>org.mongodb.spark</groupId>
15- <artifactId>mongo-spark-connector </artifactId>
31+ <artifactId>mongo-spark-connector_{+scala-previous+} </artifactId>
1632 <version>{+current-version+}</version>
1733 </dependency>
1834 <dependency>
1935 <groupId>org.apache.spark</groupId>
20- <artifactId>spark-core_{+scala-version +}</artifactId>
36+ <artifactId>spark-core_{+scala-previous +}</artifactId>
2137 <version>{+spark-core-version+}</version>
2238 </dependency>
2339 <dependency>
2440 <groupId>org.apache.spark</groupId>
25- <artifactId>spark-sql_{+scala-version +}</artifactId>
41+ <artifactId>spark-sql_{+scala-previous +}</artifactId>
2642 <version>{+spark-sql-version+}</version>
2743 </dependency>
2844 </dependencies>
0 commit comments