Skip to content

Commit 10d7b33

Browse files
authored
Support two major spring boot version in azure spring boot modules (Azure#15073)
* change parent to spring-boot-starter-parent in pom * update replace config for testing spring boot 2.2.9 version
1 parent c686c4a commit 10d7b33

File tree

7 files changed

+86
-131
lines changed

7 files changed

+86
-131
lines changed

sdk/spring/azure-spring-boot-test-aad/pom.xml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
6-
<groupId>com.azure</groupId>
7-
<artifactId>azure-client-sdk-parent</artifactId>
8-
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
9-
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
9+
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>
1212

@@ -28,7 +28,6 @@
2828
<dependency>
2929
<groupId>org.springframework.boot</groupId>
3030
<artifactId>spring-boot-starter-test</artifactId>
31-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
3231
<scope>test</scope>
3332
</dependency>
3433
</dependencies>
@@ -39,21 +38,6 @@
3938

4039
<build>
4140
<plugins>
42-
<plugin>
43-
<groupId>org.apache.maven.plugins</groupId>
44-
<artifactId>maven-enforcer-plugin</artifactId>
45-
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
46-
<configuration>
47-
<rules>
48-
<bannedDependencies>
49-
<includes>
50-
<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} -->
51-
<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} -->
52-
</includes>
53-
</bannedDependencies>
54-
</rules>
55-
</configuration>
56-
</plugin>
5741
<plugin>
5842
<groupId>org.apache.maven.plugins</groupId>
5943
<artifactId>maven-failsafe-plugin</artifactId>

sdk/spring/azure-spring-boot-test-core/pom.xml

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
6-
<groupId>com.azure</groupId>
7-
<artifactId>azure-client-sdk-parent</artifactId>
8-
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
9-
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
9+
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>
1212

@@ -19,7 +19,6 @@
1919
<dependency>
2020
<groupId>org.springframework.boot</groupId>
2121
<artifactId>spring-boot</artifactId>
22-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot;external_dependency} -->
2322
</dependency>
2423
<dependency>
2524
<groupId>org.springframework</groupId>
@@ -29,7 +28,6 @@
2928
<dependency>
3029
<groupId>org.springframework.boot</groupId>
3130
<artifactId>spring-boot-starter-web</artifactId>
32-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
3331
</dependency>
3432
<dependency>
3533
<groupId>org.apache.maven</groupId>
@@ -84,37 +82,4 @@
8482
<version>2.4.0-beta.1</version> <!-- {x-version-update;com.microsoft.azure:azure-spring-boot-starter;current} -->
8583
</dependency>
8684
</dependencies>
87-
88-
<build>
89-
<plugins>
90-
<plugin>
91-
<groupId>org.apache.maven.plugins</groupId>
92-
<artifactId>maven-enforcer-plugin</artifactId>
93-
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
94-
<configuration>
95-
<rules>
96-
<bannedDependencies>
97-
<includes>
98-
<include>com.microsoft.azure:azure:[1.34.0]</include> <!-- {x-include-update;spring_com.microsoft.azure:azure;external_dependency} -->
99-
<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} -->
100-
<include>com.jcraft:jsch:[0.1.54]</include> <!-- {x-include-update;com.jcraft:jsch;external_dependency} -->
101-
<include>com.github.cverges.expect4j:expect4j:[1.6]</include> <!-- {x-include-update;com.github.cverges.expect4j:expect4j;external_dependency} -->
102-
<include>org.apache.maven:maven-embedder:[3.6.2]</include> <!-- {x-include-update;org.apache.maven:maven-embedder;external_dependency} -->
103-
<include>org.apache.maven:maven-compat:[3.6.2]</include> <!-- {x-include-update;org.apache.maven:maven-compat;external_dependency} -->
104-
<include>org.apache.maven.wagon:wagon-http:[3.3.4]</include> <!-- {x-include-update;org.apache.maven.wagon:wagon-http;external_dependency} -->
105-
<include>org.apache.maven.wagon:wagon-provider-api:[3.3.4]</include> <!-- {x-include-update;org.apache.maven.wagon:wagon-provider-api;external_dependency} -->
106-
<include>org.eclipse.aether:aether-connector-basic:[1.1.0]</include> <!-- {x-include-update;org.eclipse.aether:aether-connector-basic;external_dependency} -->
107-
<include>org.eclipse.aether:aether-transport-wagon:[1.1.0]</include> <!-- {x-include-update;org.eclipse.aether:aether-transport-wagon;external_dependency} -->
108-
<include>org.springframework.boot:spring-boot:[2.3.3.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot;external_dependency} -->
109-
<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} -->
110-
<include>org.springframework:spring-context:[5.2.8.RELEASE]</include> <!-- {x-include-update;org.springframework:spring-context;external_dependency} -->
111-
</includes>
112-
</bannedDependencies>
113-
</rules>
114-
</configuration>
115-
</plugin>
116-
</plugins>
117-
</build>
118-
119-
12085
</project>

sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
6-
<groupId>com.azure</groupId>
7-
<artifactId>azure-client-sdk-parent</artifactId>
8-
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
9-
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
9+
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>
1212

@@ -28,18 +28,15 @@
2828
<dependency>
2929
<groupId>org.springframework.boot</groupId>
3030
<artifactId>spring-boot-starter-test</artifactId>
31-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
3231
<scope>test</scope>
3332
</dependency>
3433
<dependency>
3534
<groupId>org.springframework.boot</groupId>
3635
<artifactId>spring-boot-starter-actuator</artifactId>
37-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-actuator;external_dependency} -->
3836
</dependency>
3937
<dependency>
4038
<groupId>org.springframework.boot</groupId>
4139
<artifactId>spring-boot-starter-web</artifactId>
42-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
4340
</dependency>
4441
</dependencies>
4542

@@ -49,22 +46,6 @@
4946

5047
<build>
5148
<plugins>
52-
<plugin>
53-
<groupId>org.apache.maven.plugins</groupId>
54-
<artifactId>maven-enforcer-plugin</artifactId>
55-
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
56-
<configuration>
57-
<rules>
58-
<bannedDependencies>
59-
<includes>
60-
<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} -->
61-
<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} -->
62-
<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} -->
63-
</includes>
64-
</bannedDependencies>
65-
</rules>
66-
</configuration>
67-
</plugin>
6849
<plugin>
6950
<groupId>org.apache.maven.plugins</groupId>
7051
<artifactId>maven-failsafe-plugin</artifactId>

sdk/spring/azure-spring-boot-test-keyvault/pom.xml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
6-
<groupId>com.azure</groupId>
7-
<artifactId>azure-client-sdk-parent</artifactId>
8-
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
9-
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
9+
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>
1212

@@ -18,18 +18,15 @@
1818
<dependency>
1919
<groupId>org.springframework.boot</groupId>
2020
<artifactId>spring-boot-starter-test</artifactId>
21-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
2221
<scope>test</scope>
2322
</dependency>
2423
<dependency>
2524
<groupId>org.springframework.boot</groupId>
2625
<artifactId>spring-boot-starter-actuator</artifactId>
27-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-actuator;external_dependency} -->
2826
</dependency>
2927
<dependency>
3028
<groupId>org.springframework.boot</groupId>
3129
<artifactId>spring-boot-starter-web</artifactId>
32-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-web;external_dependency} -->
3330
</dependency>
3431
<dependency>
3532
<groupId>com.microsoft.azure</groupId>
@@ -64,23 +61,6 @@
6461

6562
<build>
6663
<plugins>
67-
<plugin>
68-
<groupId>org.apache.maven.plugins</groupId>
69-
<artifactId>maven-enforcer-plugin</artifactId>
70-
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
71-
<configuration>
72-
<rules>
73-
<bannedDependencies>
74-
<includes>
75-
<include>com.microsoft.azure:azure:[1.34.0]</include> <!-- {x-include-update;spring_com.microsoft.azure:azure;external_dependency} -->
76-
<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} -->
77-
<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} -->
78-
<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} -->
79-
</includes>
80-
</bannedDependencies>
81-
</rules>
82-
</configuration>
83-
</plugin>
8464
<plugin>
8565
<groupId>org.apache.maven.plugins</groupId>
8666
<artifactId>maven-failsafe-plugin</artifactId>

sdk/spring/azure-spring-boot-test-servicebus-jms/pom.xml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
6-
<groupId>com.azure</groupId>
7-
<artifactId>azure-client-sdk-parent</artifactId>
8-
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
9-
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
9+
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111

1212
<groupId>com.azure</groupId>
@@ -28,7 +28,6 @@
2828
<dependency>
2929
<groupId>org.springframework.boot</groupId>
3030
<artifactId>spring-boot-starter-test</artifactId>
31-
<version>2.3.3.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
3231
<scope>test</scope>
3332
<exclusions>
3433
<exclusion>
@@ -41,20 +40,6 @@
4140

4241
<build>
4342
<plugins>
44-
<plugin>
45-
<groupId>org.apache.maven.plugins</groupId>
46-
<artifactId>maven-enforcer-plugin</artifactId>
47-
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
48-
<configuration>
49-
<rules>
50-
<bannedDependencies>
51-
<includes>
52-
<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} -->
53-
</includes>
54-
</bannedDependencies>
55-
</rules>
56-
</configuration>
57-
</plugin>
5843
<plugin>
5944
<groupId>org.apache.maven.plugins</groupId>
6045
<artifactId>maven-failsafe-plugin</artifactId>

sdk/spring/scripts/replace_util.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,34 @@
2626
}
2727
},
2828
'spring': {
29+
'sdk/spring/azure-spring-boot-test-core/pom.xml': {
30+
VERSION_UPDATE_ITEMS: (
31+
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
32+
)
33+
},
34+
'sdk/spring/azure-spring-boot-test-aad/pom.xml': {
35+
VERSION_UPDATE_ITEMS: (
36+
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
37+
)
38+
},
39+
'sdk/spring/azure-spring-boot-test-application/pom.xml': {
40+
VERSION_UPDATE_ITEMS: (
41+
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
42+
)
43+
},
2944
'sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml': {
30-
ARTIFACT_ID_PAIRS: (
31-
ArtifactIdPair('azure-cosmosdb-spring-boot-2-3-starter', 'azure-cosmosdb-spring-boot-2-2-starter'),
32-
),
3345
VERSION_UPDATE_ITEMS: (
34-
VersionUpdateItem('org.springframework.boot:spring-boot-starter-web', '2.2.9.RELEASE'),
35-
VersionUpdateItem('org.springframework.boot:spring-boot-starter-actuator', '2.2.9.RELEASE'),
36-
VersionUpdateItem('org.springframework.boot:spring-boot-starter-test', '2.2.9.RELEASE')
46+
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
47+
)
48+
},
49+
'sdk/spring/azure-spring-boot-test-keyvault/pom.xml': {
50+
VERSION_UPDATE_ITEMS: (
51+
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
52+
)
53+
},
54+
'sdk/spring/azure-spring-boot-test-servicebus-jms/pom.xml': {
55+
VERSION_UPDATE_ITEMS: (
56+
VersionUpdateItem('org.springframework.boot:spring-boot-starter-parent', '2.2.9.RELEASE'),
3757
)
3858
}
3959
}

sdk/spring/tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,43 @@ jobs:
4646
AAD_SINGLE_TENANT_CLIENT_SECRET: $(java-spring-aad-single-tenant-secret)
4747
AAD_SINGLE_TENANT_CLIENT_ID_WITH_ROLE: $(java-spring-aad-single-tenant-id-with-role)
4848
AAD_SINGLE_TENANT_CLIENT_SECRET_WITH_ROLE: $(java-spring-aad-single-tenant-secret-with-role)
49+
50+
PostRunSteps:
51+
- script: |
52+
python --version
53+
python -m pip install setuptools termcolor in_place
54+
python sdk/spring/scripts/replace_util.py --module spring --log debug --color false
55+
displayName: 'Run replace_util.py'
56+
57+
- task: Maven@3
58+
displayName: 'Build and Install again, JDK Version: $(JavaBuildVersion)'
59+
inputs:
60+
mavenPomFile: pom.xml
61+
goals: 'install'
62+
options: '$(DefaultOptions) -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true -pl $(ProjectList) -am'
63+
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
64+
javaHomeOption: 'JDKVersion'
65+
jdkVersionOption: $(JavaBuildVersion)
66+
jdkArchitectureOption: 'x64'
67+
publishJUnitResults: false
68+
69+
- task: Maven@3
70+
displayName: 'Run tests again, JDK Version: $(JavaBuildVersion)'
71+
inputs:
72+
mavenPomFile: pom.xml
73+
goals: verify
74+
options: '-Dmaven.wagon.http.pool=false $(DefaultOptions) -Dmaven.javadoc.skip=true -Drevapi.skip=true -DskipSpringITs=false -pl $(ProjectList)'
75+
env:
76+
AZURE_TEST_MODE: LIVE
77+
AAD_TENANT_ID_1: $(java-spring-aad-tenant-id-1)
78+
AAD_USER_NAME_1: $(java-spring-aad-user-name-1)
79+
AAD_USER_PASSWORD_1: $(java-spring-aad-user-password-1)
80+
AAD_TENANT_ID_2: $(java-spring-aad-tenant-id-2)
81+
AAD_USER_NAME_2: $(java-spring-aad-user-name-2)
82+
AAD_USER_PASSWORD_2: $(java-spring-aad-user-password-2)
83+
AAD_MULTI_TENANT_CLIENT_ID: $(java-spring-aad-multi-tenant-client-id)
84+
AAD_MULTI_TENANT_CLIENT_SECRET: $(java-spring-aad-multi-tenant-client-secret)
85+
AAD_SINGLE_TENANT_CLIENT_ID: $(java-spring-aad-single-tenant-id)
86+
AAD_SINGLE_TENANT_CLIENT_SECRET: $(java-spring-aad-single-tenant-secret)
87+
AAD_SINGLE_TENANT_CLIENT_ID_WITH_ROLE: $(java-spring-aad-single-tenant-id-with-role)
88+
AAD_SINGLE_TENANT_CLIENT_SECRET_WITH_ROLE: $(java-spring-aad-single-tenant-secret-with-role)

0 commit comments

Comments
 (0)