From 7c2443578cd5e6d293a385efb42cfe9dc9e8bc4e Mon Sep 17 00:00:00 2001 From: zhoufenqin Date: Mon, 7 Sep 2020 13:06:45 +0800 Subject: [PATCH] Revert "Implement new version schema for cosmosdb starter (#14465)" (#14867) This reverts commit a5acccf35cbf14ce990188b4f60920bc7f3a6292. --- .gitignore | 4 - eng/jacoco-test-coverage/pom.xml | 9 +- .../templates/stages/cosmos-sdk-client.yml | 4 +- eng/versioning/external_dependencies.txt | 9 - eng/versioning/version_client.txt | 3 +- sdk/cosmos/tests.yml | 4 +- sdk/spring/README.md | 4 +- .../CHANGELOG.md | 4 - .../README.md | 57 ----- .../pom.xml | 181 ---------------- .../src/main/resources/cosmosdb.enable.config | 1 - .../pom.xml | 4 +- .../azure-spring-boot-sample-cosmosdb/pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../CHANGELOG.md | 0 .../README.md | 14 +- .../pom.xml | 8 +- .../src/main/resources/cosmosdb.enable.config | 0 .../azure-spring-boot-starter/README.md | 3 +- .../azure-spring-boot-test-cosmosdb/pom.xml | 6 +- sdk/spring/azure-spring-boot/README.md | 3 +- sdk/spring/ci.yml | 7 +- sdk/spring/pom.xml | 3 +- sdk/spring/scripts/artifact_id_pair.py | 11 - sdk/spring/scripts/replace_artifact.py | 108 ++++++++++ sdk/spring/scripts/replace_util.py | 202 ------------------ sdk/spring/scripts/version_update_item.py | 11 - sdk/spring/tests.yml | 40 ---- 29 files changed, 142 insertions(+), 570 deletions(-) delete mode 100644 sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/CHANGELOG.md delete mode 100644 sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/README.md delete mode 100644 sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/pom.xml delete mode 100644 sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/src/main/resources/cosmosdb.enable.config rename sdk/spring/{azure-spring-boot-2-3-starter-cosmosdb => azure-spring-boot-starter-cosmosdb}/CHANGELOG.md (100%) rename sdk/spring/{azure-spring-boot-2-3-starter-cosmosdb => azure-spring-boot-starter-cosmosdb}/README.md (94%) rename sdk/spring/{azure-spring-boot-2-3-starter-cosmosdb => azure-spring-boot-starter-cosmosdb}/pom.xml (96%) rename sdk/spring/{azure-spring-boot-2-2-starter-cosmosdb => azure-spring-boot-starter-cosmosdb}/src/main/resources/cosmosdb.enable.config (100%) delete mode 100644 sdk/spring/scripts/artifact_id_pair.py create mode 100644 sdk/spring/scripts/replace_artifact.py delete mode 100644 sdk/spring/scripts/replace_util.py delete mode 100644 sdk/spring/scripts/version_update_item.py diff --git a/.gitignore b/.gitignore index 08f1238124660..59d73dd145552 100644 --- a/.gitignore +++ b/.gitignore @@ -80,7 +80,3 @@ jacoco.exec # Generated client pom file ClientAggregatePom.xml - - -# Anaconda virtual -venv diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 8320394d3a31e..e3c74fb2d4ded 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -364,13 +364,8 @@ com.microsoft.azure - azure-cosmosdb-spring-boot-2-3-starter - 2.4.0-beta.1 - - - com.microsoft.azure - azure-cosmosdb-spring-boot-2-2-starter - 2.4.0-beta.1 + azure-cosmosdb-spring-boot-starter + 2.4.0-beta.1 com.microsoft.azure diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index 2d6e1c7948f2a..5496e68350f6e 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -153,9 +153,9 @@ stages: - script: | python --version python -m pip install setuptools termcolor in_place - python sdk/spring/scripts/replace_util.py --module cosmos --log debug --color false + python sdk/spring/scripts/replace_artifact.py --module cosmos --log debug --color false condition: eq(variables['DisplayName'], 'Spring Emulator only Integration Tests') - displayName: 'Run replace_util.py' + displayName: 'Run replace_artifact.py' - task: Maven@3 condition: eq(variables['DisplayName'], 'Spring Emulator only Integration Tests') displayName: 'Run tests again: $(DisplayName)' diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 02cb28990d00c..381f75876cd7e 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -316,14 +316,5 @@ storage_com.microsoft.azure:azure-storage;8.4.0 # sdk\spring\azure-spring-boot\pom.xml spring_com.microsoft.azure:azure;1.34.0 -# sdk\spring\azure-spring-boot-2-2-starter-cosmosdb\pom.xml -springboot22_com.microsoft.azure:spring-data-cosmosdb;2.2.2.M2 -springboot22_org.springframework.boot:spring-boot-starter;2.2.9.RELEASE -springboot22_org.springframework.boot:spring-boot;2.2.9.RELEASE -springboot22_org.springframework.boot:spring-boot-starter-validation;2.2.9.RELEASE -springboot22_org.springframework.boot:spring-boot-starter-test;2.2.9.RELEASE -springboot22_org.springframework.boot:spring-boot-starter-actuator;2.2.9.RELEASE -springboot22_org.springframework.boot:spring-boot-starter-web;2.2.9.RELEASE - # sdk\cosmos springdata22_org.springframework.data:spring-data-commons;2.2.9.RELEASE diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 99923bb848830..958fa887898fb 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -91,8 +91,7 @@ com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.0.0-beta.4;2.0. com.azure.resourcemanager:azure-resourcemanager-test;2.0.0-beta.4;2.0.0-beta.5 com.microsoft.azure:azure-active-directory-b2c-spring-boot-starter;2.3.3;2.4.0-beta.1 com.microsoft.azure:azure-active-directory-spring-boot-starter;2.3.3;2.4.0-beta.1 -com.microsoft.azure:azure-cosmosdb-spring-boot-2-3-starter;2.4.0-beta.1;2.4.0-beta.1 -com.microsoft.azure:azure-cosmosdb-spring-boot-2-2-starter;2.4.0-beta.1;2.4.0-beta.1 +com.microsoft.azure:azure-cosmosdb-spring-boot-starter;2.3.3;2.4.0-beta.1 com.microsoft.azure:azure-data-gremlin-spring-boot-starter;2.3.3;2.4.0-beta.1 com.microsoft.azure:azure-keyvault-secrets-spring-boot-starter;2.3.3;2.4.0-beta.1 com.microsoft.azure:azure-servicebus-jms-spring-boot-starter;2.3.3;2.4.0-beta.1 diff --git a/sdk/cosmos/tests.yml b/sdk/cosmos/tests.yml index 761a1ca6c0be3..c048cb8791f65 100644 --- a/sdk/cosmos/tests.yml +++ b/sdk/cosmos/tests.yml @@ -270,8 +270,8 @@ jobs: - script: | python --version python -m pip install setuptools termcolor in_place - python sdk/spring/scripts/replace_util.py --module cosmos --log debug --color false - displayName: 'Run replace_util.py' + python sdk/spring/scripts/replace_artifact.py --module cosmos --log debug --color false + displayName: 'Run replace_artifact.py' - task: Maven@3 displayName: 'Build and Install again, JDK Version: $(JavaBuildVersion)' inputs: diff --git a/sdk/spring/README.md b/sdk/spring/README.md index f7f3fc17bf14a..4a831a548a9d5 100644 --- a/sdk/spring/README.md +++ b/sdk/spring/README.md @@ -25,9 +25,7 @@ Starter Name | Version for Spring Boot 2.3.x | Version for Spring Boot 2.2.x | V [azure-storage-spring-boot-starter](azure-spring-boot-starter-storage/README.md) | N/A | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-storage-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-storage-spring-boot-starter%22) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-storage-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-storage-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-storage-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-storage-spring-boot-starter%20AND%20v:2.0.*) [azure-keyvault-secrets-spring-boot-starter](azure-spring-boot-starter-keyvault-secrets/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-keyvault-secrets-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-keyvault-secrets-spring-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-keyvault-secrets-spring-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-keyvault-secrets-spring-boot-starter%20AND%20v:2.2.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-keyvault-secrets-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-keyvault-secrets-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-keyvault-secrets-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-keyvault-secrets-spring-boot-starter%20AND%20v:2.0.*) [azure-active-directory-b2c-spring-boot-starter](azure-spring-boot-starter-active-directory-b2c/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-active-directory-b2c-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-active-directory-b2c-spring-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-active-directory-b2c-spring-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-active-directory-b2c-spring-boot-starter%20AND%20v:2.2.*) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-active-directory-b2c-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-active-directory-b2c-spring-boot-starter%20AND%20v:2.1.*) | N/A -azure-cosmosdb-spring-boot-starter | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-cosmosdb-spring-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.2.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.0.*) -[azure-cosmosdb-spring-boot-2-2-starter](azure-spring-boot-2-2-starter-cosmosdb/README.md) | N/A | N/A | N/A | N/A -[azure-cosmosdb-spring-boot-2-3-starter](azure-spring-boot-2-3-starter-cosmosdb/README.md) | N/A | N/A | N/A | N/A +[azure-cosmosdb-spring-boot-starter](azure-spring-boot-starter-cosmosdb/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-cosmosdb-spring-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.2.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.0.*) [azure-mediaservices-spring-boot-starter](azure-spring-boot-starter-mediaservices/README.md) | N/A | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-mediaservices-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-mediaservices-spring-boot-starter%22) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-mediaservices-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-mediaservices-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-mediaservices-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-mediaservices-spring-boot-starter%20AND%20v:2.0.*) [azure-servicebus-spring-boot-starter](azure-spring-boot-starter-servicebus/README.md) | N/A | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-servicebus-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-servicebus-spring-boot-starter%22) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-servicebus-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-servicebus-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-servicebus-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-servicebus-spring-boot-starter%20AND%20v:2.0.*) [spring-data-gremlin-boot-starter](azure-spring-boot-starter-data-gremlin/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-gremlin-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22spring-data-gremlin-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-gremlin-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-gremlin-boot-starter%20AND%20v:2.2.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-gremlin-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-gremlin-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-gremlin-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-gremlin-boot-starter%20AND%20v:2.0.*) diff --git a/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/CHANGELOG.md b/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/CHANGELOG.md deleted file mode 100644 index b995c29e5fc99..0000000000000 --- a/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/CHANGELOG.md +++ /dev/null @@ -1,4 +0,0 @@ -# Release History - - -## 2.4.0-beta.1 (Unreleased) diff --git a/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/README.md b/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/README.md deleted file mode 100644 index 0d606e3065544..0000000000000 --- a/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Azure Cosmos DB Spring Boot 2.2 Starter client library for Java - -[Azure Cosmos DB](https://azure.microsoft.com/services/cosmos-db/) is a globally-distributed database service that allows developers to work with data using a variety of standard APIs, such as SQL, MongoDB, Graph, and Azure Table storage. - -[Package (Maven)][package] | [API reference documentation][refdocs] | [Product documentation][docs] | [Samples][sample] - -## Getting started -### Prerequisites -- Java Development Kit (JDK) with version 8 or above -- [Azure Subscription][azure_subscription] -- [Maven](http://maven.apache.org/) 3.0 and above - -### Include the package -[//]: # ({x-version-update-start;com.microsoft.azure:azure-cosmosdb-spring-boot-2-2-starter;current}) -```xml - - com.microsoft.azure - azure-cosmosdb-spring-boot-2-2-starter - 2.4.0-beta.1 - -``` -[//]: # ({x-version-update-end}) - -## Key concepts -Please refer to [Azure Cosmos DB Spring Boot 2.3 Starter][azure_spring_boot_2_3_starter_cosmosdb_readme_key_concepts] for key concepts. - -## Examples -Please refer to [Azure Cosmos DB Spring Boot 2.3 Starter][azure_spring_boot_2_3_starter_cosmosdb_readme_examples] for examples. - -## Troubleshooting -Please refer to [Azure Cosmos DB Spring Boot 2.3 Starter][azure_spring_boot_2_3_starter_cosmosdb_readme_troubleshooting] for troubleshooting. - -## Next steps - -Besides using this Azure CosmosDb Spring Boot Starter, you can directly use Spring Data for Azure CosmosDb package for more complex scenarios. Please refer to [Spring Data for Azure CosmosDB](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-spring-data-cosmos-core) for more details. - -The following section provide a sample project illustrating how to use the starter. -### More sample code -- [Cosmos DB SQL API][cosmos_db_sql_api] - -## Contributing -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - -Please follow [instructions here][contributing_readme] to build from source or contribute. - - -[docs]: https://docs.microsoft.com/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-cosmos-db -[refdocs]: https://azure.github.io/azure-sdk-for-java/spring.html#azure-cosmosdb-spring-boot-starter -[package]: https://mvnrepository.com/artifact/com.microsoft.azure/azure-cosmosdb-spring-boot-starter -[sample]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb -[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK#use-logback-logging-framework-in-a-spring-boot-application -[azure_subscription]: https://azure.microsoft.com/free -[azure_spring_boot_2_3_starter_cosmosdb_readme_key_concepts]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb#key-concepts -[azure_spring_boot_2_3_starter_cosmosdb_readme_examples]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb#examples -[azure_spring_boot_2_3_starter_cosmosdb_readme_troubleshooting]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb#troubleshooting -[cosmos_db_sql_api]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb -[contributing_readme]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/CONTRIBUTING.md diff --git a/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/pom.xml deleted file mode 100644 index 7e37ea64bd44c..0000000000000 --- a/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/pom.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - 4.0.0 - - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.microsoft.azure - azure-cosmosdb-spring-boot-2-2-starter - 2.4.0-beta.1 - - Azure Cosmos DB Spring Boot 2.2 Starter - Spring Boot 2.2 Starter for Azure Cosmos DB service - https://github.com/Azure/azure-sdk-for-java - - - - org.springframework.boot - spring-boot-starter - 2.2.9.RELEASE - - - org.springframework.boot - spring-boot-starter-validation - 2.2.9.RELEASE - - - com.microsoft.azure - azure-spring-boot - 2.4.0-beta.1 - - - com.microsoft.azure - spring-data-cosmosdb - 2.2.2.M2 - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M3 - - - - - com.microsoft.azure:azure-spring-boot:[2.4.0-beta.1] - com.microsoft.azure:spring-data-cosmosdb:[2.2.2.M2] - org.springframework.boot:spring-boot-starter:[2.2.9.RELEASE] - org.springframework.boot:spring-boot-starter-validation:[2.2.9.RELEASE] - - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.1 - - - attach-javadocs - - jar - - - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.2 - - - - empty-javadoc-jar-with-readme - package - - jar - - - javadoc - ${project.basedir}/javadocTemp - - - - - - empty-sources-jar-with-readme - package - - jar - - - sources - ${project.basedir}/sourceTemp - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.8 - - - copy-readme-to-javadocTemp - prepare-package - - - Deleting existing ${project.basedir}/javadocTemp - - - - Copying ${project.basedir}/README.md to - ${project.basedir}/javadocTemp/README.md - - - - - - run - - - - copy-readme-to-sourceTemp - prepare-package - - - Deleting existing ${project.basedir}/sourceTemp - - - - Copying ${project.basedir}/README.md to - ${project.basedir}/sourceTemp/README.md - - - - - - run - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - none - - - - - - - diff --git a/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/src/main/resources/cosmosdb.enable.config b/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/src/main/resources/cosmosdb.enable.config deleted file mode 100644 index 2995a4d0e7491..0000000000000 --- a/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/src/main/resources/cosmosdb.enable.config +++ /dev/null @@ -1 +0,0 @@ -dummy \ No newline at end of file diff --git a/sdk/spring/azure-spring-boot-samples/azure-cloud-foundry-service-sample/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-cloud-foundry-service-sample/pom.xml index c37a2dd629992..0679465ad6b90 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-cloud-foundry-service-sample/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-cloud-foundry-service-sample/pom.xml @@ -21,8 +21,8 @@ com.microsoft.azure - azure-cosmosdb-spring-boot-2-3-starter - 2.4.0-beta.1 + azure-cosmosdb-spring-boot-starter + 2.4.0-beta.1 com.microsoft.azure diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb/pom.xml index 6de0c15674b86..0b34ed7bd23d0 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb/pom.xml @@ -21,8 +21,8 @@ com.microsoft.azure - azure-cosmosdb-spring-boot-2-3-starter - 2.4.0-beta.1 + azure-cosmosdb-spring-boot-starter + 2.4.0-beta.1 org.springframework.boot diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-appconfiguration-conversion-sample-complete/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-appconfiguration-conversion-sample-complete/pom.xml index 2e6af04539aec..6433a1c135d9a 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-appconfiguration-conversion-sample-complete/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-appconfiguration-conversion-sample-complete/pom.xml @@ -30,8 +30,8 @@ com.microsoft.azure - azure-cosmosdb-spring-boot-2-3-starter - 2.4.0-beta.1 + azure-cosmosdb-spring-boot-starter + 2.4.0-beta.1 com.google.guava diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-appconfiguration-conversion-sample-initial/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-appconfiguration-conversion-sample-initial/pom.xml index a111862ac459c..644d98045c0a7 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-appconfiguration-conversion-sample-initial/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-appconfiguration-conversion-sample-initial/pom.xml @@ -31,8 +31,8 @@ com.microsoft.azure - azure-cosmosdb-spring-boot-2-3-starter - 2.4.0-beta.1 + azure-cosmosdb-spring-boot-starter + 2.4.0-beta.1 com.google.guava diff --git a/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/CHANGELOG.md b/sdk/spring/azure-spring-boot-starter-cosmosdb/CHANGELOG.md similarity index 100% rename from sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/CHANGELOG.md rename to sdk/spring/azure-spring-boot-starter-cosmosdb/CHANGELOG.md diff --git a/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/README.md b/sdk/spring/azure-spring-boot-starter-cosmosdb/README.md similarity index 94% rename from sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/README.md rename to sdk/spring/azure-spring-boot-starter-cosmosdb/README.md index 99a5854cc9ae4..c75c96d6a5e8b 100644 --- a/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/README.md +++ b/sdk/spring/azure-spring-boot-starter-cosmosdb/README.md @@ -1,4 +1,4 @@ -# Azure Cosmos DB Spring Boot 2.3 Starter client library for Java +# Azure Cosmos DB Spring Boot Starter client library for Java [Azure Cosmos DB](https://azure.microsoft.com/services/cosmos-db/) is a globally-distributed database service that allows developers to work with data using a variety of standard APIs, such as SQL, MongoDB, Graph, and Azure Table storage. @@ -11,12 +11,12 @@ - [Maven](http://maven.apache.org/) 3.0 and above ### Include the package -[//]: # ({x-version-update-start;com.microsoft.azure:azure-cosmosdb-spring-boot-2-3-starter;current}) +[//]: # ({x-version-update-start;com.microsoft.azure:azure-cosmosdb-spring-boot-starter;current}) ```xml com.microsoft.azure - azure-cosmosdb-spring-boot-2-3-starter - 2.4.0-beta.1 + azure-cosmosdb-spring-boot-starter + 2.3.3 ``` [//]: # ({x-version-update-end}) @@ -235,12 +235,12 @@ Besides using this Azure CosmosDb Spring Boot Starter, you can directly use Spri The following section provide a sample project illustrating how to use the starter. ### More sample code -- [Cosmos DB SQL API][cosmos_db_sql_api] +- [Cosmos DB SQL API](../azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb) ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. -Please follow [instructions here][contributing_readme] to build from source or contribute. +Please follow [instructions here](../CONTRIBUTING.md) to build from source or contribute. [docs]: https://docs.microsoft.com/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-cosmos-db @@ -249,5 +249,3 @@ Please follow [instructions here][contributing_readme] to build from source or c [sample]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb [logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK#use-logback-logging-framework-in-a-spring-boot-application [azure_subscription]: https://azure.microsoft.com/free -[cosmos_db_sql_api]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb -[contributing_readme]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/CONTRIBUTING.md diff --git a/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml similarity index 96% rename from sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/pom.xml rename to sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml index 2893b8da1b2c1..a9c4a380fd0a6 100644 --- a/sdk/spring/azure-spring-boot-2-3-starter-cosmosdb/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml @@ -12,11 +12,11 @@ com.microsoft.azure - azure-cosmosdb-spring-boot-2-3-starter - 2.4.0-beta.1 + azure-cosmosdb-spring-boot-starter + 2.4.0-beta.1 - Azure Cosmos DB Spring Boot 2.3 Starter - Spring Boot 2.3 Starter for Azure Cosmos DB service + Azure Cosmos DB Spring Boot Starter + Spring Boot Starter for Azure Document DB service https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/src/main/resources/cosmosdb.enable.config b/sdk/spring/azure-spring-boot-starter-cosmosdb/src/main/resources/cosmosdb.enable.config similarity index 100% rename from sdk/spring/azure-spring-boot-2-2-starter-cosmosdb/src/main/resources/cosmosdb.enable.config rename to sdk/spring/azure-spring-boot-starter-cosmosdb/src/main/resources/cosmosdb.enable.config diff --git a/sdk/spring/azure-spring-boot-starter/README.md b/sdk/spring/azure-spring-boot-starter/README.md index 9f23a4fff799a..2bf40e9f73681 100644 --- a/sdk/spring/azure-spring-boot-starter/README.md +++ b/sdk/spring/azure-spring-boot-starter/README.md @@ -35,8 +35,7 @@ Starter Name | Version for Spring Boot 2.3.x | Version for Spring Boot 2.2.x | V [azure-storage-spring-boot-starter](../azure-spring-boot-starter-storage/README.md) | N/A | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-storage-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-storage-spring-boot-starter%22) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-storage-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-storage-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-storage-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-storage-spring-boot-starter%20AND%20v:2.0.*) [azure-keyvault-secrets-spring-boot-starter](../azure-spring-boot-starter-keyvault-secrets/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-keyvault-secrets-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-keyvault-secrets-spring-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-keyvault-secrets-spring-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-keyvault-secrets-spring-boot-starter%20AND%20v:2.2.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-keyvault-secrets-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-keyvault-secrets-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-keyvault-secrets-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-keyvault-secrets-spring-boot-starter%20AND%20v:2.0.*) [azure-active-directory-b2c-spring-boot-starter](../azure-spring-boot-starter-active-directory-b2c/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-active-directory-b2c-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-active-directory-b2c-spring-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-active-directory-b2c-spring-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-active-directory-b2c-spring-boot-starter%20AND%20v:2.2.*) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-active-directory-b2c-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-active-directory-b2c-spring-boot-starter%20AND%20v:2.1.*) | N/A -[azure-cosmosdb-spring-boot-2-2-starter](../azure-spring-boot-2-2-starter-cosmosdb/README.md) | N/A | N/A | N/A | N/A -[azure-cosmosdb-spring-boot-2-3-starter](../azure-spring-boot-2-3-starter-cosmosdb/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-cosmosdb-spring-boot-2-3-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.2.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.0.*) +[azure-cosmosdb-spring-boot-starter](../azure-spring-boot-starter-cosmosdb/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-cosmosdb-spring-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.2.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-cosmosdb-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-cosmosdb-spring-boot-starter%20AND%20v:2.0.*) [azure-mediaservices-spring-boot-starter](../azure-spring-boot-starter-mediaservices/README.md) | N/A | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-mediaservices-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-mediaservices-spring-boot-starter%22) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-mediaservices-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-mediaservices-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-mediaservices-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-mediaservices-spring-boot-starter%20AND%20v:2.0.*) [azure-servicebus-spring-boot-starter](../azure-spring-boot-starter-servicebus/README.md) | N/A | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-servicebus-spring-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22azure-servicebus-spring-boot-starter%22) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-servicebus-spring-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-servicebus-spring-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/azure-servicebus-spring-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:azure-servicebus-spring-boot-starter%20AND%20v:2.0.*) [spring-data-gremlin-boot-starter](../azure-spring-boot-starter-data-gremlin/README.md) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-gremlin-boot-starter.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.microsoft.azure%22%20AND%20a%3A%22spring-data-gremlin-boot-starter%22) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-gremlin-boot-starter/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-gremlin-boot-starter%20AND%20v:2.2.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-gremlin-boot-starter/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-gremlin-boot-starter%20AND%20v:2.1.*) | [![](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-gremlin-boot-starter/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-gremlin-boot-starter%20AND%20v:2.0.*) diff --git a/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml index 71086b12e90ce..dc244b8da17d3 100644 --- a/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml +++ b/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml @@ -17,8 +17,8 @@ com.microsoft.azure - azure-cosmosdb-spring-boot-2-3-starter - 2.4.0-beta.1 + azure-cosmosdb-spring-boot-starter + 2.4.0-beta.1 com.azure @@ -57,7 +57,7 @@ - com.microsoft.azure:azure-cosmosdb-spring-boot-2-3-starter:[2.4.0-beta.1] + com.microsoft.azure:azure-cosmosdb-spring-boot-starter:[2.4.0-beta.1] org.springframework.boot:spring-boot-starter-web:[2.3.3.RELEASE] org.springframework.boot:spring-boot-starter-actuator:[2.3.3.RELEASE] diff --git a/sdk/spring/azure-spring-boot/README.md b/sdk/spring/azure-spring-boot/README.md index 1888ceca398cf..65463e267c349 100644 --- a/sdk/spring/azure-spring-boot/README.md +++ b/sdk/spring/azure-spring-boot/README.md @@ -43,8 +43,7 @@ This project provides auto-configuration for the following Azure services: - [Azure Active Directory](../azure-spring-boot-starter-active-directory) - [Azure Active Directory B2C](../azure-spring-boot-starter-active-directory-b2c) -- [Spring Boot 2.2 for Cosmos DB SQL API](../azure-spring-boot-2-2-starter-cosmosdb) -- [Spring Boot 2.3 for Cosmos DB SQL API](../azure-spring-boot-2-3-starter-cosmosdb) +- [Cosmos DB SQL API](../azure-spring-boot-starter-cosmosdb) - [Gremlin SQL API](../azure-spring-boot-starter-data-gremlin) - [Key Vault Secrets](../azure-spring-boot-starter-keyvault-secrets) - [Metrics Service](../azure-spring-boot-starter-metrics) diff --git a/sdk/spring/ci.yml b/sdk/spring/ci.yml index 9a5987522fe44..1d5edd75f02ba 100644 --- a/sdk/spring/ci.yml +++ b/sdk/spring/ci.yml @@ -42,12 +42,9 @@ extends: - name: azure-active-directory-b2c-spring-boot-starter groupId: com.microsoft.azure safeName: azurespringbootstarteractivedirectoryb2c - - name: azure-cosmosdb-spring-boot-2-2-starter + - name: azure-cosmosdb-spring-boot-starter groupId: com.microsoft.azure - safeName: azurespringboot22startercosmosdb - - name: azure-cosmosdb-spring-boot-2-3-starter - groupId: com.microsoft.azure - safeName: azurespringboot23startercosmosdb + safeName: azurespringbootstartercosmosdb - name: azure-data-gremlin-spring-boot-starter groupId: com.microsoft.azure safeName: azurespringbootstarterdatagremlin diff --git a/sdk/spring/pom.xml b/sdk/spring/pom.xml index ac725ef8dae60..cb812169cc9ab 100644 --- a/sdk/spring/pom.xml +++ b/sdk/spring/pom.xml @@ -13,8 +13,7 @@ azure-spring-boot-starter azure-spring-boot-starter-active-directory azure-spring-boot-starter-active-directory-b2c - azure-spring-boot-2-2-starter-cosmosdb - azure-spring-boot-2-3-starter-cosmosdb + azure-spring-boot-starter-cosmosdb azure-spring-boot-starter-data-gremlin azure-spring-boot-starter-keyvault-secrets azure-spring-boot-starter-metrics diff --git a/sdk/spring/scripts/artifact_id_pair.py b/sdk/spring/scripts/artifact_id_pair.py deleted file mode 100644 index 18c2f995445fb..0000000000000 --- a/sdk/spring/scripts/artifact_id_pair.py +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - - -class ArtifactIdPair: - def __init__(self, old_artifact_id, new_artifact_id): - self.old_artifact_id = old_artifact_id - self.new_artifact_id = new_artifact_id - - def __str__(self): - return '[old_artifact_id: {}; new_artifact_id: {}]'.format(self.old_artifact_id, self.new_artifact_id) diff --git a/sdk/spring/scripts/replace_artifact.py b/sdk/spring/scripts/replace_artifact.py new file mode 100644 index 0000000000000..87eec38c15a5d --- /dev/null +++ b/sdk/spring/scripts/replace_artifact.py @@ -0,0 +1,108 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + + +import argparse +import os +import time + +import in_place + +from log import log, Log + +config = { + 'cosmos': { + 'artifact_dict': { + 'azure-spring-data-2-3-cosmos': 'azure-spring-data-2-2-cosmos' + }, + 'pom_list': [ + 'sdk/cosmos/azure-spring-data-cosmos-test/pom.xml' + ] + } +} + + +def main(): + start_time = time.time() + change_to_root_dir() + log.debug('Current working directory = {}.'.format(os.getcwd())) + args = get_args() + init_log(args) + replace_artifact(args.module) + elapsed_time = time.time() - start_time + log.info('elapsed_time = {}'.format(elapsed_time)) + + +def change_to_root_dir(): + os.chdir(os.path.dirname(os.path.realpath(__file__))) + os.chdir('../../..') + + +def get_args(): + parser = argparse.ArgumentParser( + description = 'Replace artifact id in pom file.' + ) + parser.add_argument( + '--module', + type = str, + choices = ['spring', 'cosmos'], + required = False, + default = 'cosmos', + help = 'Specify the target module.' + ) + parser.add_argument( + '--log', + type = str, + choices = ['debug', 'info', 'warn', 'error', 'none'], + required = False, + default = 'info', + help = 'Set log level.' + ) + parser.add_argument( + '--color', + type = str, + choices = ['true', 'false'], + required = False, + default = 'true', + help = 'Whether need colorful log.' + ) + return parser.parse_args() + + +def init_log(args): + log_dict = { + 'debug': Log.DEBUG, + 'info': Log.INFO, + 'warn': Log.WARN, + 'error': Log.ERROR, + 'none': Log.NONE + } + log.set_log_level(log_dict[args.log]) + color_dict = { + 'true': True, + 'false': False + } + log.set_color(color_dict[args.color]) + + +def replace_artifact(module): + artifact_dict = config[module]['artifact_dict'] + pom_list = config[module]['pom_list'] + for pom in pom_list: + log.info('Processing file: {}'.format(pom)) + with in_place.InPlace(pom) as file: + line_num = 0 + for line in file: + line_num = line_num + 1 + for key, value in artifact_dict.items(): + new_line = line.replace(key, value) + if line != new_line: + log.debug('Updated line {}'.format(line_num)) + log.debug(' old_line = {}.'.format(line.strip('\n'))) + log.debug(' new_line = {}.'.format(new_line.strip('\n'))) + line = new_line + file.write(line) + + +if __name__ == '__main__': + main() diff --git a/sdk/spring/scripts/replace_util.py b/sdk/spring/scripts/replace_util.py deleted file mode 100644 index 884af92eb4f4b..0000000000000 --- a/sdk/spring/scripts/replace_util.py +++ /dev/null @@ -1,202 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - - -import argparse -import os -import time - -import in_place - -from log import log, Log -from artifact_id_pair import ArtifactIdPair -from version_update_item import VersionUpdateItem - -X_VERSION_UPDATE = 'x-version-update' -X_INCLUDE_UPDATE = 'x-include-update' -ARTIFACT_ID_PAIRS = 'artifact_id_pairs' -VERSION_UPDATE_ITEMS = 'version_update_items' - -config = { - 'cosmos': { - 'sdk/cosmos/azure-spring-data-cosmos-test/pom.xml': { - ARTIFACT_ID_PAIRS: ( - ArtifactIdPair('azure-spring-data-2-3-cosmos', 'azure-spring-data-2-2-cosmos'), - ) - } - }, - 'spring': { - 'sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml': { - ARTIFACT_ID_PAIRS: ( - ArtifactIdPair('azure-cosmosdb-spring-boot-2-3-starter', 'azure-cosmosdb-spring-boot-2-2-starter'), - ), - VERSION_UPDATE_ITEMS: ( - VersionUpdateItem('org.springframework.boot:spring-boot-starter-web', '2.2.9.RELEASE'), - VersionUpdateItem('org.springframework.boot:spring-boot-starter-actuator', '2.2.9.RELEASE'), - VersionUpdateItem('org.springframework.boot:spring-boot-starter-test', '2.2.9.RELEASE') - ) - } - } -} - - -def main(): - start_time = time.time() - change_to_root_dir() - log.debug('Current working directory = {}.'.format(os.getcwd())) - args = get_args() - init_log(args) - replace(args.module) - elapsed_time = time.time() - start_time - log.info('elapsed_time = {}'.format(elapsed_time)) - - -def change_to_root_dir(): - os.chdir(os.path.dirname(os.path.realpath(__file__))) - os.chdir('../../..') - - -def get_args(): - parser = argparse.ArgumentParser( - description = 'Replace artifact id in pom file.' - ) - parser.add_argument( - '--module', - type = str, - choices = ['spring', 'cosmos'], - required = False, - default = 'cosmos', - help = 'Specify the target module.' - ) - parser.add_argument( - '--log', - type = str, - choices = ['debug', 'info', 'warn', 'error', 'none'], - required = False, - default = 'info', - help = 'Set log level.' - ) - parser.add_argument( - '--color', - type = str, - choices = ['true', 'false'], - required = False, - default = 'true', - help = 'Whether need colorful log.' - ) - return parser.parse_args() - - -def init_log(args): - log_dict = { - 'debug': Log.DEBUG, - 'info': Log.INFO, - 'warn': Log.WARN, - 'error': Log.ERROR, - 'none': Log.NONE - } - log.set_log_level(log_dict[args.log]) - color_dict = { - 'true': True, - 'false': False - } - log.set_color(color_dict[args.color]) - - -def replace(module): - """ - Replace action - :param module: module name - """ - for pom in config[module].keys(): - replace_artifact_id(module, pom) - replace_version(module, pom) - - -def get_str(tuple_obj): - """ - Return str list for tuple obj for logger. - :param tuple_obj: tuple obj - :return: string list - """ - str_list = list() - for item in tuple_obj: - str_list.append(str(item)) - return str_list - - -def replace_artifact_id(module, pom): - """ - Replace artifactId in dependency and plugin part. - :param module: module name - :param pom: pom file path - """ - log.debug('Replacing artifact id in file: {}'.format(pom, module)) - pom_dict = config[module][pom] - if ARTIFACT_ID_PAIRS not in pom_dict: - log.warn('No config key {} in pom parameters.'.format(ARTIFACT_ID_PAIRS)) - return - - artifact_id_pairs = pom_dict[ARTIFACT_ID_PAIRS] - log.debug('Module: {}, artifact ids: {}'.format(module, get_str(artifact_id_pairs))) - with in_place.InPlace(pom) as file: - line_num = 0 - for line in file: - line_num = line_num + 1 - for artifact_id_pair in artifact_id_pairs: - if artifact_id_pair.old_artifact_id in line: - new_line = line.replace(artifact_id_pair.old_artifact_id, artifact_id_pair.new_artifact_id) - log.debug('Updating artifact id in line {}'.format(line_num)) - log.debug(' old_line = {}.'.format(line.strip('\n'))) - log.debug(' new_line = {}.'.format(new_line.strip('\n'))) - line = new_line - file.write(line) - - -def replace_version(module, pom): - """ - Replace version in dependency and plugin part. - :param module: module name - :param pom: pom file path - """ - log.debug('Replacing version in file: {}'.format(pom)) - pom_dict = config[module][pom] - if VERSION_UPDATE_ITEMS not in pom_dict: - log.warn('No config key {} in pom parameters.'.format(VERSION_UPDATE_ITEMS)) - return - - version_update_items = pom_dict[VERSION_UPDATE_ITEMS] - log.debug('Module: {}, versions: {}'.format(module, get_str(version_update_items))) - with in_place.InPlace(pom) as file: - line_num = 0 - for line in file: - line_num = line_num + 1 - for version_update_item in version_update_items: - if version_update_item.id in line: - # update version in dependency part - if X_VERSION_UPDATE in line: - old_version = line[(line.index('') + 9):line.index('')] - if old_version != version_update_item.new_version: - new_line = line.replace(old_version, version_update_item.new_version) - log.debug('Updating version of dependency in line {}'.format(line_num)) - log.debug(' old_line = {}.'.format(line.strip('\n'))) - log.debug(' new_line = {}.'.format(new_line.strip('\n'))) - line = new_line - else: - log.warn('The same with new version in dependency part.') - # update version in plugin part - elif X_INCLUDE_UPDATE in line: - old_version = line[(line.index('[') + 1):line.index(']')] - if old_version != version_update_item.new_version: - new_line = line.replace(old_version, version_update_item.new_version) - log.debug('Updating line {}'.format(line_num)) - log.debug(' old_line = {}.'.format(line.strip('\n'))) - log.debug(' new_line = {}.'.format(new_line.strip('\n'))) - line = new_line - else: - log.warn('The same with new version in plugin part.') - file.write(line) - - -if __name__ == '__main__': - main() diff --git a/sdk/spring/scripts/version_update_item.py b/sdk/spring/scripts/version_update_item.py deleted file mode 100644 index a4f359893b53c..0000000000000 --- a/sdk/spring/scripts/version_update_item.py +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - - -class VersionUpdateItem: - def __init__(self, id, new_version): - self.id = id - self.new_version = new_version - - def __str__(self): - return '[id: {}; new_version: {}]'.format(self.id, self.new_version) diff --git a/sdk/spring/tests.yml b/sdk/spring/tests.yml index a298e4d836096..de0904c206cdb 100644 --- a/sdk/spring/tests.yml +++ b/sdk/spring/tests.yml @@ -46,43 +46,3 @@ jobs: AAD_SINGLE_TENANT_CLIENT_SECRET: $(java-spring-aad-single-tenant-secret) AAD_SINGLE_TENANT_CLIENT_ID_WITH_ROLE: $(java-spring-aad-single-tenant-id-with-role) AAD_SINGLE_TENANT_CLIENT_SECRET_WITH_ROLE: $(java-spring-aad-single-tenant-secret-with-role) - - PostRunSteps: - - script: | - python --version - python -m pip install setuptools termcolor in_place - python sdk/spring/scripts/replace_util.py --module spring --log debug --color false - displayName: 'Run replace_util.py' - - - task: Maven@3 - displayName: 'Build and Install again, JDK Version: $(JavaBuildVersion)' - inputs: - mavenPomFile: pom.xml - goals: 'install' - options: '$(DefaultOptions) -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true -pl $(ProjectList) -am' - mavenOptions: '$(MemoryOptions) $(LoggingOptions)' - javaHomeOption: 'JDKVersion' - jdkVersionOption: $(JavaBuildVersion) - jdkArchitectureOption: 'x64' - publishJUnitResults: false - - - task: Maven@3 - displayName: 'Run tests again, JDK Version: $(JavaBuildVersion)' - inputs: - mavenPomFile: pom.xml - goals: verify - options: '-Dmaven.wagon.http.pool=false $(DefaultOptions) -Dmaven.javadoc.skip=true -Drevapi.skip=true -DskipSpringITs=false -pl $(ProjectList)' - env: - AZURE_TEST_MODE: LIVE - AAD_TENANT_ID_1: $(java-spring-aad-tenant-id-1) - AAD_USER_NAME_1: $(java-spring-aad-user-name-1) - AAD_USER_PASSWORD_1: $(java-spring-aad-user-password-1) - AAD_TENANT_ID_2: $(java-spring-aad-tenant-id-2) - AAD_USER_NAME_2: $(java-spring-aad-user-name-2) - AAD_USER_PASSWORD_2: $(java-spring-aad-user-password-2) - AAD_MULTI_TENANT_CLIENT_ID: $(java-spring-aad-multi-tenant-client-id) - AAD_MULTI_TENANT_CLIENT_SECRET: $(java-spring-aad-multi-tenant-client-secret) - AAD_SINGLE_TENANT_CLIENT_ID: $(java-spring-aad-single-tenant-id) - AAD_SINGLE_TENANT_CLIENT_SECRET: $(java-spring-aad-single-tenant-secret) - AAD_SINGLE_TENANT_CLIENT_ID_WITH_ROLE: $(java-spring-aad-single-tenant-id-with-role) - AAD_SINGLE_TENANT_CLIENT_SECRET_WITH_ROLE: $(java-spring-aad-single-tenant-secret-with-role)