Skip to content

Commit

Permalink
Support two major spring boot version in azure spring boot modules (#…
Browse files Browse the repository at this point in the history
…15073)

* change parent to spring-boot-starter-parent in pom

* update replace config for testing spring boot 2.2.9 version
  • Loading branch information
moarychan authored Sep 15, 2020
1 parent c686c4a commit 10d7b33
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 131 deletions.
24 changes: 4 additions & 20 deletions sdk/spring/azure-spring-boot-test-aad/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -28,7 +28,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -39,21 +38,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>com.microsoft.azure:azure-active-directory-spring-boot-starter:[2.4.0-beta.1]</include> <!-- {x-include-update;com.microsoft.azure:azure-active-directory-spring-boot-starter;current} -->
<include>org.springframework.boot:spring-boot-starter-web:[2.3.3.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down
43 changes: 4 additions & 39 deletions sdk/spring/azure-spring-boot-test-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -19,7 +19,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot;external_dependency} -->
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -29,7 +28,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -84,37 +82,4 @@
<version>2.4.0-beta.1</version> <!-- {x-version-update;com.microsoft.azure:azure-spring-boot-starter;current} -->
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>com.microsoft.azure:azure:[1.34.0]</include> <!-- {x-include-update;spring_com.microsoft.azure:azure;external_dependency} -->
<include>com.microsoft.azure:azure-spring-boot-starter:[2.4.0-beta.1]</include> <!-- {x-include-update;com.microsoft.azure:azure-spring-boot-starter;current} -->
<include>com.jcraft:jsch:[0.1.54]</include> <!-- {x-include-update;com.jcraft:jsch;external_dependency} -->
<include>com.github.cverges.expect4j:expect4j:[1.6]</include> <!-- {x-include-update;com.github.cverges.expect4j:expect4j;external_dependency} -->
<include>org.apache.maven:maven-embedder:[3.6.2]</include> <!-- {x-include-update;org.apache.maven:maven-embedder;external_dependency} -->
<include>org.apache.maven:maven-compat:[3.6.2]</include> <!-- {x-include-update;org.apache.maven:maven-compat;external_dependency} -->
<include>org.apache.maven.wagon:wagon-http:[3.3.4]</include> <!-- {x-include-update;org.apache.maven.wagon:wagon-http;external_dependency} -->
<include>org.apache.maven.wagon:wagon-provider-api:[3.3.4]</include> <!-- {x-include-update;org.apache.maven.wagon:wagon-provider-api;external_dependency} -->
<include>org.eclipse.aether:aether-connector-basic:[1.1.0]</include> <!-- {x-include-update;org.eclipse.aether:aether-connector-basic;external_dependency} -->
<include>org.eclipse.aether:aether-transport-wagon:[1.1.0]</include> <!-- {x-include-update;org.eclipse.aether:aether-transport-wagon;external_dependency} -->
<include>org.springframework.boot:spring-boot:[2.3.3.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot;external_dependency} -->
<include>org.springframework.boot:spring-boot-starter-web:[2.3.3.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
<include>org.springframework:spring-context:[5.2.8.RELEASE]</include> <!-- {x-include-update;org.springframework:spring-context;external_dependency} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
</plugins>
</build>


</project>
27 changes: 4 additions & 23 deletions sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -28,18 +28,15 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-actuator;external_dependency} -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
</dependency>
</dependencies>

Expand All @@ -49,22 +46,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>com.microsoft.azure:azure-cosmosdb-spring-boot-starter:[2.4.0-beta.1]</include> <!-- {x-include-update;com.microsoft.azure:azure-cosmosdb-spring-boot-starter;current} -->
<include>org.springframework.boot:spring-boot-starter-web:[2.3.3.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
<include>org.springframework.boot:spring-boot-starter-actuator:[2.3.3.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-actuator;external_dependency} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down
28 changes: 4 additions & 24 deletions sdk/spring/azure-spring-boot-test-keyvault/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -18,18 +18,15 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-actuator;external_dependency} -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
Expand Down Expand Up @@ -64,23 +61,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>com.microsoft.azure:azure:[1.34.0]</include> <!-- {x-include-update;spring_com.microsoft.azure:azure;external_dependency} -->
<include>com.microsoft.azure:azure-keyvault-secrets-spring-boot-starter:[2.4.0-beta.1]</include> <!-- {x-include-update;com.microsoft.azure:azure-keyvault-secrets-spring-boot-starter;current} -->
<include>org.springframework.boot:spring-boot-starter-actuator:[2.3.3.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-actuator;external_dependency} -->
<include>org.springframework.boot:spring-boot-starter-web:[2.3.3.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down
23 changes: 4 additions & 19 deletions sdk/spring/azure-spring-boot-test-servicebus-jms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>com.azure</groupId>
Expand All @@ -28,7 +28,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -41,20 +40,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>com.microsoft.azure:azure-servicebus-jms-spring-boot-starter:[2.4.0-beta.1]</include> <!-- {x-include-update;com.microsoft.azure:azure-servicebus-jms-spring-boot-starter;current} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down
32 changes: 26 additions & 6 deletions sdk/spring/scripts/replace_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,34 @@
}
},
'spring': {
'sdk/spring/azure-spring-boot-test-core/pom.xml': {
VERSION_UPDATE_ITEMS: (
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
)
},
'sdk/spring/azure-spring-boot-test-aad/pom.xml': {
VERSION_UPDATE_ITEMS: (
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
)
},
'sdk/spring/azure-spring-boot-test-application/pom.xml': {
VERSION_UPDATE_ITEMS: (
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
)
},
'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')
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
)
},
'sdk/spring/azure-spring-boot-test-keyvault/pom.xml': {
VERSION_UPDATE_ITEMS: (
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
)
},
'sdk/spring/azure-spring-boot-test-servicebus-jms/pom.xml': {
VERSION_UPDATE_ITEMS: (
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
)
}
}
Expand Down
40 changes: 40 additions & 0 deletions sdk/spring/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,43 @@ 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)

0 comments on commit 10d7b33

Please sign in to comment.