Skip to content

Commit 7128835

Browse files
committed
docs: add BOM usage instructions to README (#1720)
Document dapr-sdk-bom as the recommended way to import the SDK, with version-free dependency declarations for both Maven and Gradle. Keep the manual version approach as an alternative. Signed-off-by: Javier Aliaga <javier@aliaga.dev> Signed-off-by: Javier Aliaga <javier@diagrid.io>
1 parent db140d3 commit 7128835

1 file changed

Lines changed: 63 additions & 11 deletions

File tree

README.md

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,47 +59,99 @@ For the full list of available APIs, see the [Dapr API reference](https://docs.d
5959
If using [SDKMAN!](https://sdkman.io), execute `sdk env install` to install the required JDK.
6060

6161
### Importing Dapr's Java SDK
62+
63+
#### Using the BOM (recommended)
64+
65+
Import `dapr-sdk-bom` to manage all Dapr SDK versions and security-patched transitive dependencies in one place. This ensures your project inherits fixes for CVEs in transitive dependencies like Netty and Jackson.
66+
6267
For a Maven project, add the following to your `pom.xml` file:
6368
```xml
6469
<project>
6570
...
71+
<dependencyManagement>
72+
<dependencies>
73+
<dependency>
74+
<groupId>io.dapr</groupId>
75+
<artifactId>dapr-sdk-bom</artifactId>
76+
<version>1.18.0</version>
77+
<type>pom</type>
78+
<scope>import</scope>
79+
</dependency>
80+
</dependencies>
81+
</dependencyManagement>
82+
6683
<dependencies>
67-
...
68-
<!-- Dapr's core SDK with all features, except Actors. -->
84+
<!-- Dapr's core SDK with all features, except Actors. -->
6985
<dependency>
7086
<groupId>io.dapr</groupId>
7187
<artifactId>dapr-sdk</artifactId>
72-
<version>1.17.2</version>
7388
</dependency>
7489
<!-- Dapr's SDK for Actors (optional). -->
7590
<dependency>
7691
<groupId>io.dapr</groupId>
7792
<artifactId>dapr-sdk-actors</artifactId>
78-
<version>1.17.2</version>
7993
</dependency>
8094
<!-- Dapr's SDK integration with SpringBoot (optional). -->
8195
<dependency>
8296
<groupId>io.dapr</groupId>
8397
<artifactId>dapr-sdk-springboot</artifactId>
84-
<version>1.17.2</version>
8598
</dependency>
86-
...
8799
</dependencies>
88100
...
89101
</project>
90102
```
91103

92104
For a Gradle project, add the following to your `build.gradle` file:
93105

94-
```
106+
```groovy
95107
dependencies {
96-
...
108+
// Import the BOM
109+
implementation platform('io.dapr:dapr-sdk-bom:1.18.0')
110+
97111
// Dapr's core SDK with all features, except Actors.
98-
compile('io.dapr:dapr-sdk:1.17.2')
112+
implementation 'io.dapr:dapr-sdk'
99113
// Dapr's SDK for Actors (optional).
100-
compile('io.dapr:dapr-sdk-actors:1.17.2')
114+
implementation 'io.dapr:dapr-sdk-actors'
101115
// Dapr's SDK integration with SpringBoot (optional).
102-
compile('io.dapr:dapr-sdk-springboot:1.17.2')
116+
implementation 'io.dapr:dapr-sdk-springboot'
117+
}
118+
```
119+
120+
#### Without the BOM
121+
122+
If you prefer to manage versions manually, specify the version on each dependency:
123+
124+
For Maven:
125+
```xml
126+
<project>
127+
...
128+
<dependencies>
129+
<dependency>
130+
<groupId>io.dapr</groupId>
131+
<artifactId>dapr-sdk</artifactId>
132+
<version>1.17.2</version>
133+
</dependency>
134+
<dependency>
135+
<groupId>io.dapr</groupId>
136+
<artifactId>dapr-sdk-actors</artifactId>
137+
<version>1.17.2</version>
138+
</dependency>
139+
<dependency>
140+
<groupId>io.dapr</groupId>
141+
<artifactId>dapr-sdk-springboot</artifactId>
142+
<version>1.17.2</version>
143+
</dependency>
144+
</dependencies>
145+
...
146+
</project>
147+
```
148+
149+
For Gradle:
150+
```groovy
151+
dependencies {
152+
implementation 'io.dapr:dapr-sdk:1.17.2'
153+
implementation 'io.dapr:dapr-sdk-actors:1.17.2'
154+
implementation 'io.dapr:dapr-sdk-springboot:1.17.2'
103155
}
104156
```
105157

0 commit comments

Comments
 (0)