From a5683556203aabcff160e2e2ab915866fb0170f3 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Thu, 28 May 2020 09:01:34 -0700 Subject: [PATCH 1/4] Remove duplicate dependency entries --- eng/jacoco-test-coverage/pom.xml | 45 ----------------------------- sdk/identity/azure-identity/pom.xml | 6 ---- 2 files changed, 51 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 9e7316268bba..2a0c04267896 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -207,21 +207,6 @@ azure-keyvault-secrets-spring-boot-starter 2.2.5-beta.1 - - com.microsoft.azure - azure-spring-boot - 2.2.5-beta.1 - - - com.microsoft.azure - azure-spring-boot-starter - 2.2.5-beta.1 - - - com.microsoft.azure - azure-active-directory-spring-boot-starter - 2.2.5-beta.1 - com.microsoft.azure azure-spring-boot-metrics-starter @@ -232,41 +217,11 @@ azure-servicebus-jms-spring-boot-starter 2.2.5-beta.1 - - com.microsoft.azure - azure-spring-boot - 2.2.5-beta.1 - - - com.microsoft.azure - azure-spring-boot-starter - 2.2.5-beta.1 - - - com.microsoft.azure - azure-active-directory-spring-boot-starter - 2.2.5-beta.1 - com.microsoft.azure azure-active-directory-b2c-spring-boot-starter 2.2.5-beta.1 - - com.microsoft.azure - azure-spring-boot - 2.2.5-beta.1 - - - com.microsoft.azure - azure-spring-boot-starter - 2.2.5-beta.1 - - - com.microsoft.azure - azure-active-directory-spring-boot-starter - 2.2.5-beta.1 - com.microsoft.azure azure-cosmosdb-spring-boot-starter diff --git a/sdk/identity/azure-identity/pom.xml b/sdk/identity/azure-identity/pom.xml index 42c04241a56c..e2e86ccccc69 100644 --- a/sdk/identity/azure-identity/pom.xml +++ b/sdk/identity/azure-identity/pom.xml @@ -99,12 +99,6 @@ test - - com.microsoft.azure - msal4j-persistence-extension - 0.1 - - org.linguafranca.pwdb KeePassJava2 From 4616f5822ed01685bb4f27da21a53b2a7760ef74 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Fri, 29 May 2020 07:43:57 -0700 Subject: [PATCH 2/4] add maven-enforcer-plugin to jacoco for spring --- eng/jacoco-test-coverage/pom.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 2a0c04267896..ddcc79376672 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -258,6 +258,26 @@ + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + + + com.azure:* + com.microsoft.azure:* + + + + + From eb8409b7a5bf524c1719e5e20047f61f1687cc96 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Fri, 29 May 2020 08:47:41 -0700 Subject: [PATCH 3/4] Fix bannedDependency includes for spring --- .../pom.xml | 2 +- .../azure-spring-boot-starter-active-directory/pom.xml | 2 +- sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml | 3 ++- .../azure-spring-boot-starter-data-gremlin/pom.xml | 2 +- .../azure-spring-boot-starter-keyvault-secrets/pom.xml | 2 +- sdk/spring/azure-spring-boot-starter-metrics/pom.xml | 2 +- .../azure-spring-boot-starter-servicebus-jms/pom.xml | 10 +--------- sdk/spring/azure-spring-boot-starter/pom.xml | 2 +- 8 files changed, 9 insertions(+), 16 deletions(-) diff --git a/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml b/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml index 3b5520ed32d4..4db7b37bb651 100644 --- a/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml @@ -98,7 +98,7 @@ - com.microsoft.azure:* + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] javax.validation:validation-api:[2.0.1.Final] org.springframework:spring-web:[5.2.5.RELEASE] org.springframework.boot:spring-boot-starter:[2.2.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml b/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml index 2903847e6022..cb3e2b9b9971 100644 --- a/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml @@ -82,7 +82,7 @@ - com.microsoft.azure:* + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] --> com.fasterxml.jackson.core:jackson-databind:[2.10.1] com.microsoft.azure:msal4j:[1.3.0] com.nimbusds:nimbus-jose-jwt:[7.9] diff --git a/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml index 18395ccedc3e..b5a290d9f3d2 100644 --- a/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml @@ -52,7 +52,8 @@ - com.microsoft.azure:* + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] + com.microsoft.azure:spring-data-cosmosdb:[2.2.3.FIX1] org.springframework.boot:spring-boot-starter:[2.2.0.RELEASE] org.springframework.boot:spring-boot-starter-validation:[2.2.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-starter-data-gremlin/pom.xml b/sdk/spring/azure-spring-boot-starter-data-gremlin/pom.xml index d8d10a829409..e1a87c5e0eca 100644 --- a/sdk/spring/azure-spring-boot-starter-data-gremlin/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-data-gremlin/pom.xml @@ -56,7 +56,7 @@ - com.microsoft.azure:* + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] com.fasterxml.jackson.core:jackson-core:[2.10.1] com.microsoft.spring.data.gremlin:spring-data-gremlin:[2.2.3] org.springframework.boot:spring-boot-starter:[2.2.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-starter-keyvault-secrets/pom.xml b/sdk/spring/azure-spring-boot-starter-keyvault-secrets/pom.xml index 748a07582963..a087a1ad5750 100644 --- a/sdk/spring/azure-spring-boot-starter-keyvault-secrets/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-keyvault-secrets/pom.xml @@ -46,7 +46,7 @@ - com.microsoft.azure:* + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] org.springframework.boot:spring-boot-starter:[2.2.0.RELEASE] org.springframework.boot:spring-boot-starter-validation:[2.2.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-starter-metrics/pom.xml b/sdk/spring/azure-spring-boot-starter-metrics/pom.xml index 2251f0ddc870..527ebeda8c12 100644 --- a/sdk/spring/azure-spring-boot-starter-metrics/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-metrics/pom.xml @@ -57,7 +57,7 @@ - com.microsoft.azure:* + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] io.micrometer:micrometer-core:[1.3.0] io.micrometer:micrometer-registry-azure-monitor:[1.3.0] org.springframework.boot:spring-boot-actuator-autoconfigure:[2.2.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml b/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml index 5e8ee73ed3cd..f74626292797 100644 --- a/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml @@ -50,16 +50,8 @@ - false - - - *:*:*:*:runtime - *:*:*:*:compile - *:*:*:*:provided - - com.microsoft.azure:* + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] org.apache.qpid:qpid-jms-client:[0.43.0] org.springframework:spring-jms:[5.2.5.RELEASE] diff --git a/sdk/spring/azure-spring-boot-starter/pom.xml b/sdk/spring/azure-spring-boot-starter/pom.xml index bb2ce52779bd..4660eefef579 100644 --- a/sdk/spring/azure-spring-boot-starter/pom.xml +++ b/sdk/spring/azure-spring-boot-starter/pom.xml @@ -47,7 +47,7 @@ - com.microsoft.azure:* + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] org.springframework.boot:spring-boot-starter:[2.2.0.RELEASE] org.springframework.boot:spring-boot-starter-validation:[2.2.0.RELEASE] From 2d30173bddd6dff332e54fd6a875a8781184ca22 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Fri, 29 May 2020 09:36:36 -0700 Subject: [PATCH 4/4] Allow x-include-update tags to be libraries as well as external dependencies --- eng/versioning/pom_file_version_scanner.ps1 | 45 +++++++++++++++---- .../pom.xml | 2 +- .../pom.xml | 2 +- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/eng/versioning/pom_file_version_scanner.ps1 b/eng/versioning/pom_file_version_scanner.ps1 index 48f925433eed..400fa5edc663 100644 --- a/eng/versioning/pom_file_version_scanner.ps1 +++ b/eng/versioning/pom_file_version_scanner.ps1 @@ -516,12 +516,12 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { if (!$includeNode.NextSibling -or $includeNode.NextSibling.NodeType -ne "Comment") { $script:FoundError = $true - Write-Error-With-Color "Error: is missing the update tag which should be " + Write-Error-With-Color "Error: is missing the update tag which should be " } - elseif ($includeNode.NextSibling.Value.Trim() -notmatch "{x-include-update;(\w+)?$($groupId):$($artifactId);external_dependency}") + elseif ($includeNode.NextSibling.Value.Trim() -notmatch "{x-include-update;(\w+)?$($groupId):$($artifactId);(current|dependency|external_dependency)}") { $script:FoundError = $true - Write-Error-With-Color "Error: version update tag for $($includeNode.InnerText) should be " + Write-Error-With-Color "Error: version update tag for $($includeNode.InnerText) should be " } else { @@ -539,18 +539,45 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { # entries in case it's an external dependency entry. Because this has already # been validated for format, grab the group:artifact $depKey = $includeNode.NextSibling.Value.Trim().Split(";")[1] - if ($extDepHash.ContainsKey($depKey)) + $depType = $includeNode.NextSibling.Value.Trim().Split(";")[2] + $depType = $depType.Substring(0, $depType.IndexOf("}")) + if ($depType -eq $DependencyTypeExternal) { - if ($versionWithoutBraces -ne $extDepHash[$depKey].ver) + if ($extDepHash.ContainsKey($depKey)) + { + if ($versionWithoutBraces -ne $extDepHash[$depKey].ver) + { + $script:FoundError = $true + Write-Error-With-Color "Error: $($depKey)'s version is '$($versionWithoutBraces)' but the external_dependency version is listed as $($extDepHash[$depKey].ver)" + } + } + else { $script:FoundError = $true - Write-Error-With-Color "Error: $($depKey)'s version is '$($versionWithoutBraces)' but the external_dependency version is listed as $($extDepHash[$depKey].ver)" + Write-Error-With-Color "Error: the groupId:artifactId entry '$($depKey)' for '$($rawIncludeText)' is not a valid external dependency. Please verify the entry exists in the external_dependencies.txt file. -->" } - } + } else { - $script:FoundError = $true - Write-Error-With-Color "Error: the groupId:artifactId entry '$($depKey)' for '$($rawIncludeText)' is not a valid external dependency. Please verify the entry exists in the external_dependencies.txt file. -->" + if ($depType -eq $DependencyTypeDependency) + { + if ($versionWithoutBraces -ne $libHash[$depKey].depVer) + { + return "Error: $($depKey)'s is '$($versionString)' but the dependency version is listed as $($libHash[$depKey].depVer)" + } + } + elseif ($depType -eq $DependencyTypeCurrent) + { + # Verify that none of the 'current' dependencies are using a groupId that starts with 'unreleased_' or 'beta_' + if ($depKey.StartsWith('unreleased_') -or $depKey.StartsWith('beta_')) + { + return "Error: $($versionUpdateString) is using an unreleased_ or beta_ dependency and trying to set current value. Only dependency versions can be set with an unreleased or beta dependency." + } + if ($versionWithoutBraces -ne $libHash[$depKey].curVer) + { + return "Error: $($depKey)'s is '$($versionString)' but the current version is listed as $($libHash[$depKey].curVer)" + } + } } } } diff --git a/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml b/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml index 4db7b37bb651..9e6eb17edab3 100644 --- a/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml @@ -98,7 +98,7 @@ - com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] javax.validation:validation-api:[2.0.1.Final] org.springframework:spring-web:[5.2.5.RELEASE] org.springframework.boot:spring-boot-starter:[2.2.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml b/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml index cb3e2b9b9971..3d104750108f 100644 --- a/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml @@ -82,7 +82,7 @@ - com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] --> + com.microsoft.azure:azure-spring-boot:[2.2.5-beta.1] --> com.fasterxml.jackson.core:jackson-databind:[2.10.1] com.microsoft.azure:msal4j:[1.3.0] com.nimbusds:nimbus-jose-jwt:[7.9]