Skip to content

Commit

Permalink
migrate to Spring Cloud Azure 4.0 (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
stliu authored Nov 18, 2021
1 parent 082a088 commit 2f7a532
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 65 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

| spring boot version | spring cloud version | azure spring boot version |
| --- | --- | --- |
| 2.5.2 | 2020.0.3 | 3.6.x |
| 2.5.2 | 2020.0.3 | [4.0](https://github.com/Azure/azure-sdk-for-java/tree/feature/azure-spring-cloud-4.0/sdk/spring) |

## All samples in this repo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,37 @@
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-parent;external_dependency} -->
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-samples</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>azure-spring-cloud-sample-eventhubs-kafka</artifactId>
<groupId>com.azure.spring</groupId>
<version>1.0.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-sample-eventhubs-kafka;dependency} -->
<version>1.0.0</version>
<name>Azure Spring Cloud Sample Event Hubs Kafka</name>

<properties>
<skipSpringITs>true</skipSpringITs>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2020.0.2</version> <!-- {x-version-update;org.springframework.cloud:spring-cloud-dependencies;external_dependency} -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-dependencies</artifactId>
<version>2.10.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-dependencies;current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-starter-eventhubs-kafka</artifactId>
<artifactId>spring-cloud-azure-resourcemanager</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>2.6.6</version> <!-- {x-version-update;spring_org.springframework.kafka:spring-kafka;external_dependency} -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-kafka</artifactId>
</dependency>
<!-- TEST-->
<dependency>
Expand All @@ -66,25 +42,4 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version> <!-- {x-version-update;org.apache.maven.plugins:maven-failsafe-plugin;external_dependency} -->
<executions>
<execution>
<id>default</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<skipITs>${skipSpringITs}</skipITs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
spring:
cloud:
azure:
client-id: ${SPRING_CLIENT_ID}
client-secret: ${SPRING_CLIENT_SECRET}
tenant-id: ${SPRING_TENANT_ID}
resource-group: ${SPRING_RESOURCE_GROUP}
subscription-id: ${SPRING_SUBSCRIPTION_ID}
eventhub:
profile:
tenant-id: ${SPRING_TENANT_ID}
subscription-id: ${SPRING_SUBSCRIPTION_ID}
# This is not required since Spring Cloud Azure support https://docs.microsoft.com/en-us/azure/developer/java/sdk/identity
# you only need to login with az cli / vs code or Intellij Azure Toolkit
# then credential information will be left out of properties
# credential:
# client-id: ${SPRING_CLIENT_ID}
# client-secret: ${SPRING_CLIENT_SECRET}
eventhubs:
namespace: ${EVENTHUB_NAMESPACE_NAME_SAMPLE_EVENTHUBS_KAFKA}
resource:
resource-group: ${SPRING_RESOURCE_GROUP}

stream:
function:
definition: consume;supply
Expand Down
30 changes: 28 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,42 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
</parent>

<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-samples</artifactId>
<packaging>pom</packaging>
<version>1.0.0</version><!-- Need not change for every release-->


<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<version.spring.cloud>2020.0.3</version.spring.cloud>
<version.spring.cloud.azure>4.0.0-beta.1</version.spring.cloud.azure>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${version.spring.cloud}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-dependencies</artifactId>
<version>${version.spring.cloud.azure}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<modules>
<module>aad/azure-spring-boot-starter-active-directory/aad-resource-server</module>
Expand Down

0 comments on commit 2f7a532

Please sign in to comment.