From 659b5c12cc41ea40ae62697d8ece82a704e86d38 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 24 Mar 2025 15:16:12 -0400 Subject: [PATCH 1/6] DOCSP-48094: BOM --- source/get-started.txt | 55 ++++++++++++++++++++++++++++++--- source/references/whats-new.txt | 6 ++++ 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/source/get-started.txt b/source/get-started.txt index 0a2a07058..1885a0c2a 100644 --- a/source/get-started.txt +++ b/source/get-started.txt @@ -70,6 +70,50 @@ its dependencies in your development environment. or `Creating New Gradle Builds `__ to learn how to set up your project. + .. step:: Add the {+driver-short+} Bill of Materials + + .. _java-get-started-install-bom: + + Add the Bill of Materials (BOM) for the MongoDB JVM + artifacts to your project to organize dependency versions. The BOM + simplifies dependency management by ensuring that you maintain + consistent and compatible versions of dependencies, such as between the + {+driver-short+} and the core driver library. Use the BOM to + avoid version conflicts and simplify upgrades. + + Select from the following :guilabel:`Maven` and :guilabel:`Gradle` tabs + to view instructions for adding the BOM for each dependency manager: + + .. tabs:: + + .. tab:: Maven + :tabid: maven bom + + Add the following code to the ``dependencyManagement`` list in your ``pom.xml`` file: + + .. code-block:: xml + + + + + org.mongodb + mongodb-driver-bom + {+full-version+} + pom + import + + + + + .. tab:: Gradle + :tabid: gradle bom + + .. code-block:: groovy + + dependencies { + implementation(platform("org.mongodb:mongodb-driver-bom:{+full-version+}")) + } + .. step:: Install the {+driver-short+} In your IDE, create a new `Maven `__ or `Gradle `__ @@ -81,7 +125,6 @@ its dependencies in your development environment. org.mongodb mongodb-driver-sync - {+full-version+} @@ -90,13 +133,17 @@ its dependencies in your development environment. .. code-block:: groovy dependencies { - implementation 'org.mongodb:mongodb-driver-sync:{+full-version+}' + implementation 'org.mongodb:mongodb-driver-sync' } + Because you installed the BOM, you can omit a version in the + {+driver-short+} dependency entry. The version you specify in the + BOM determines the dependency versions to install. + After you configure your dependencies, ensure they are available to your project by running your dependency manager and refreshing the project in your IDE. - + After you complete these steps, you have a new project and the driver dependencies installed. @@ -247,4 +294,4 @@ visiting the following guides: - :ref:`java-db-coll`: Learn more about interacting with MongoDB databases and collections. - :ref:`java-integrations`: Learn about the third-party - integrations that you can use with the {+driver-short+}. \ No newline at end of file + integrations that you can use with the {+driver-short+}. diff --git a/source/references/whats-new.txt b/source/references/whats-new.txt index 7af6dc3f2..f74e597ff 100644 --- a/source/references/whats-new.txt +++ b/source/references/whats-new.txt @@ -39,6 +39,12 @@ What's New in 5.4 The 5.4 driver release includes the following changes, fixes, and features: +- Introduces a Bill of Materials (BOM) to manage versions of MongoDB JVM + artifacts you might use in your application. See the + :ref:`java-get-started-install-bom` step of the Get Started with the + Java Driver tutorial to view instructions on adding the BOM to your + application. + .. sharedinclude:: dbx/jvm/v5.4-wn-items.rst .. replacement:: sort-option-link From 76b392dc349d271db73e378d2a6d1f96d6565c59 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 24 Mar 2025 15:20:56 -0400 Subject: [PATCH 2/6] small fix --- source/references/whats-new.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/references/whats-new.txt b/source/references/whats-new.txt index f74e597ff..62618dccd 100644 --- a/source/references/whats-new.txt +++ b/source/references/whats-new.txt @@ -40,10 +40,10 @@ The 5.4 driver release includes the following changes, fixes, and features: - Introduces a Bill of Materials (BOM) to manage versions of MongoDB JVM - artifacts you might use in your application. See the - :ref:`java-get-started-install-bom` step of the Get Started with the - Java Driver tutorial to view instructions on adding the BOM to your - application. + artifacts you might use in your application. To view instructions on + adding the BOM to your application, see the + :ref:`Add the {+driver-short+} Bill of Materials + ` step of the Get Started tutorial. .. sharedinclude:: dbx/jvm/v5.4-wn-items.rst From eea3680a8a17dde55629495a4a450e5a6fd850d3 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 24 Mar 2025 15:23:28 -0400 Subject: [PATCH 3/6] small fix --- source/get-started.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/get-started.txt b/source/get-started.txt index 1885a0c2a..4623ca3de 100644 --- a/source/get-started.txt +++ b/source/get-started.txt @@ -74,12 +74,14 @@ its dependencies in your development environment. .. _java-get-started-install-bom: - Add the Bill of Materials (BOM) for the MongoDB JVM - artifacts to your project to organize dependency versions. The BOM - simplifies dependency management by ensuring that you maintain - consistent and compatible versions of dependencies, such as between the - {+driver-short+} and the core driver library. Use the BOM to - avoid version conflicts and simplify upgrades. + In your IDE, create a new `Maven `__ or + `Gradle `__ project. Add the Bill of + Materials (BOM) for MongoDB JVM artifacts to your project to + organize dependency versions. The BOM simplifies dependency + management by ensuring that you maintain consistent and compatible + versions of dependencies, such as between the {+driver-short+} and + the core driver library. Use the BOM to avoid version conflicts + and simplify upgrades. Select from the following :guilabel:`Maven` and :guilabel:`Gradle` tabs to view instructions for adding the BOM for each dependency manager: @@ -116,8 +118,7 @@ its dependencies in your development environment. .. step:: Install the {+driver-short+} - In your IDE, create a new `Maven `__ or `Gradle `__ - project. If you use Maven, add the following code to your ``pom.xml`` dependencies list: + If you use Maven, add the following code to your ``pom.xml`` dependencies list: .. code-block:: xml From 19ba1bed784998515e53bf3b45bd9422b5491575 Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 25 Mar 2025 09:38:30 -0400 Subject: [PATCH 4/6] fixes --- source/connection/connection-troubleshooting.txt | 2 +- source/get-started.txt | 8 ++++++-- source/includes/crud/example-intro.rst | 16 ++++++++-------- source/references/whats-new.txt | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/source/connection/connection-troubleshooting.txt b/source/connection/connection-troubleshooting.txt index 5aee84cb4..ae2d905eb 100644 --- a/source/connection/connection-troubleshooting.txt +++ b/source/connection/connection-troubleshooting.txt @@ -250,7 +250,7 @@ against the connected secondary node if you set the read preference to You can also specify the ``serverSelectionTimeoutMS`` connection option to adjust the amount of time in which the driver must select a server. To -learn more, see the :ref:`java-connection-uri-options` guide. +learn more, see the :ref:`mcs-cluster-settings` guide. .. _java-miscellaneous-errors: diff --git a/source/get-started.txt b/source/get-started.txt index 4623ca3de..e1571f8e7 100644 --- a/source/get-started.txt +++ b/source/get-started.txt @@ -91,8 +91,9 @@ its dependencies in your development environment. .. tab:: Maven :tabid: maven bom - Add the following code to the ``dependencyManagement`` list in your ``pom.xml`` file: - + Add the following code to the ``dependencyManagement`` list in your + ``pom.xml`` file: + .. code-block:: xml @@ -110,6 +111,9 @@ its dependencies in your development environment. .. tab:: Gradle :tabid: gradle bom + Add the following code to dependencies list in your + ``build.gradle`` file: + .. code-block:: groovy dependencies { diff --git a/source/includes/crud/example-intro.rst b/source/includes/crud/example-intro.rst index e2b1374dd..4cb388032 100644 --- a/source/includes/crud/example-intro.rst +++ b/source/includes/crud/example-intro.rst @@ -1,10 +1,10 @@ .. note:: Example Setup - This example connects to an instance of MongoDB by using a connection URI. To learn - more about connecting to your MongoDB instance, see the :ref:`connection guide - `. This example also uses the ``movies`` collection in the - ``sample_mflix`` database included in the :atlas:`Atlas sample datasets - `. You can load them into - your database on the free tier of MongoDB Atlas by following the :atlas:`Get - Started with Atlas Guide - `. \ No newline at end of file + This example connects to an instance of MongoDB by using a + connection URI. To learn more about connecting to your MongoDB + instance, see the :ref:`java-connect-to-mongodb` guide. This example + also uses the ``movies`` collection in the ``sample_mflix`` database + included in the :atlas:`Atlas sample datasets `. You + can load them into your database on the free tier of MongoDB Atlas + by following the :atlas:`Get Started with Atlas Guide + `. diff --git a/source/references/whats-new.txt b/source/references/whats-new.txt index 62618dccd..482bfaf46 100644 --- a/source/references/whats-new.txt +++ b/source/references/whats-new.txt @@ -40,7 +40,7 @@ The 5.4 driver release includes the following changes, fixes, and features: - Introduces a Bill of Materials (BOM) to manage versions of MongoDB JVM - artifacts you might use in your application. To view instructions on + artifacts that you might use in your application. To view instructions on adding the BOM to your application, see the :ref:`Add the {+driver-short+} Bill of Materials ` step of the Get Started tutorial. From bd0190b8e92a923c5371bd2be5d62c5969a8a44f Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 31 Mar 2025 16:10:55 -0400 Subject: [PATCH 5/6] implement sharedinclude --- source/get-started.txt | 48 +++------------------------------ source/references/whats-new.txt | 10 +++---- 2 files changed, 8 insertions(+), 50 deletions(-) diff --git a/source/get-started.txt b/source/get-started.txt index e1571f8e7..a36a6d39b 100644 --- a/source/get-started.txt +++ b/source/get-started.txt @@ -74,51 +74,11 @@ its dependencies in your development environment. .. _java-get-started-install-bom: - In your IDE, create a new `Maven `__ or - `Gradle `__ project. Add the Bill of - Materials (BOM) for MongoDB JVM artifacts to your project to - organize dependency versions. The BOM simplifies dependency - management by ensuring that you maintain consistent and compatible - versions of dependencies, such as between the {+driver-short+} and - the core driver library. Use the BOM to avoid version conflicts - and simplify upgrades. - - Select from the following :guilabel:`Maven` and :guilabel:`Gradle` tabs - to view instructions for adding the BOM for each dependency manager: - - .. tabs:: - - .. tab:: Maven - :tabid: maven bom + .. sharedinclude:: dbx/jvm/v5.4-wn-items.rst + + .. replacement:: gradle-filename - Add the following code to the ``dependencyManagement`` list in your - ``pom.xml`` file: - - .. code-block:: xml - - - - - org.mongodb - mongodb-driver-bom - {+full-version+} - pom - import - - - - - .. tab:: Gradle - :tabid: gradle bom - - Add the following code to dependencies list in your - ``build.gradle`` file: - - .. code-block:: groovy - - dependencies { - implementation(platform("org.mongodb:mongodb-driver-bom:{+full-version+}")) - } + ``build.gradle`` .. step:: Install the {+driver-short+} diff --git a/source/references/whats-new.txt b/source/references/whats-new.txt index 1a453be32..d565b6d36 100644 --- a/source/references/whats-new.txt +++ b/source/references/whats-new.txt @@ -39,14 +39,12 @@ What's New in 5.4 The 5.4 driver release includes the following changes, fixes, and features: -- Introduces a Bill of Materials (BOM) to manage versions of MongoDB JVM - artifacts that you might use in your application. To view instructions on - adding the BOM to your application, see the - :ref:`Add the {+driver-short+} Bill of Materials - ` step of the Get Started tutorial. - .. sharedinclude:: dbx/jvm/v5.4-wn-items.rst + .. replacement:: install-bom-link + + the :ref:`Add the {+driver-short+} Bill of Materials ` step of the Get Started tutorial + .. replacement:: sort-option-link the :ref:`java-sync-client-bulk-write-update` and From 7e7cc917d17fbf0ec5b71bc64fa334583b83f283 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 31 Mar 2025 16:16:08 -0400 Subject: [PATCH 6/6] fix link --- source/get-started.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/get-started.txt b/source/get-started.txt index a36a6d39b..941d04ff7 100644 --- a/source/get-started.txt +++ b/source/get-started.txt @@ -74,7 +74,7 @@ its dependencies in your development environment. .. _java-get-started-install-bom: - .. sharedinclude:: dbx/jvm/v5.4-wn-items.rst + .. sharedinclude:: dbx/jvm/bom.rst .. replacement:: gradle-filename