Skip to content

Commit 18a0e53

Browse files
committed
Incorporate PR review feedback for "getting-spring-security" documentation (#16234)
- Fixed minor formatting issues and addressed reviewer suggestions. - Issue gh-16228.
1 parent 6fe76f5 commit 18a0e53

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

docs/modules/ROOT/pages/getting-spring-security.adoc

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[[getting]]
2+
[[getting-gradle]]
23
= Getting Spring Security
34

45
This section describes how to get the Spring Security binaries.
@@ -15,13 +16,13 @@ Typically, these are done to provide improved security to match modern security
1516

1617

1718
[[maven]]
18-
== Usage with Maven and Gradle
19+
== Usage
1920

2021
As most open source projects, Spring Security deploys its dependencies as Maven artifacts, which makes them compatible with both Maven and Gradle. The following sections demonstrate how to integrate Spring Security with these build tools, with examples for Spring Boot and standalone usage.
2122

2223
[[getting-maven-boot]]
2324
[[getting-gradle-boot]]
24-
=== Spring Boot with Maven and Gradle
25+
=== Spring Boot
2526

2627
Spring Boot provides a `spring-boot-starter-security` starter that aggregates Spring Security-related dependencies.
2728
The simplest and preferred way to use the starter is to use https://docs.spring.io/initializr/docs/current/reference/html/[Spring Initializr] by using an IDE integration in (https://joshlong.com/jl/blogPost/tech_tip_geting_started_with_spring_boot.html[Eclipse] or https://www.jetbrains.com/help/idea/spring-boot.html#d1489567e2[IntelliJ], https://github.com/AlexFalappa/nb-springboot/wiki/Quick-Tour[NetBeans]) or through https://start.spring.io.
@@ -56,7 +57,7 @@ dependencies {
5657
======
5758

5859
Since Spring Boot provides a Maven BOM to manage dependency versions, you do not need to specify a version.
59-
If you wish to override the Spring Security version, you can do so by providing a Maven property or declaring it as a Gradle property, as shown below:
60+
If you wish to override the Spring Security version, you can do so with a build property as shown below:
6061

6162
[tabs]
6263
======
@@ -83,7 +84,7 @@ ext['spring-security.version']='{spring-security-version}'
8384

8485
Since Spring Security makes breaking changes only in major releases, you can safely use a newer version of Spring Security with Spring Boot.
8586
However, at times, you may need to update the version of Spring Framework as well.
86-
You can do so by adding a Maven or Gradle property:
87+
You can do so by adding a build property like so:
8788

8889
[tabs]
8990
======
@@ -113,7 +114,7 @@ If you use additional features (such as LDAP, OAuth 2, and others), you need to
113114
[[getting-maven-no-boot]]
114115
=== Standalone Usage (Without Spring Boot)
115116

116-
When you use Spring Security without Spring Boot, the preferred way is to use Spring Security's BOM to ensure that a consistent version of Spring Security is used throughout the entire project. For Gradle, you can do so by using the https://github.com/spring-gradle-plugins/dependency-management-plugin[Dependency Management Plugin]:
117+
When you use Spring Security without Spring Boot, the preferred way is to use Spring Security's BOM to ensure that a consistent version of Spring Security is used throughout the entire project.
117118

118119
[tabs]
119120
======
@@ -154,6 +155,8 @@ dependencyManagement {
154155
----
155156
======
156157

158+
[TIP]
159+
Spring provides a https://github.com/spring-gradle-plugins/dependency-management-plugin[`Dependency Management Plugin`] for Gradle
157160

158161
A minimal Spring Security Maven set of dependencies typically looks like the following example:
159162

@@ -194,7 +197,7 @@ If you use additional features (such as LDAP, OAuth 2, and others), you need to
194197

195198
Spring Security builds against Spring Framework {spring-core-version} but should generally work with any newer version of Spring Framework 5.x.
196199
Many users are likely to run afoul of the fact that Spring Security's transitive dependencies resolve Spring Framework {spring-core-version}, which can cause strange classpath problems.
197-
The easiest way to resolve this is to use the `spring-framework-bom` within the `<dependencyManagement>` section of your `pom.xml` or your `dependencyManagement` section of your `build.gradle`. For Gradle, you can do so by using the https://github.com/spring-gradle-plugins/dependency-management-plugin[Dependency Management Plugin]:
200+
The easiest way to resolve this is to use the `spring-framework-bom` within the `<dependencyManagement>` section of your `pom.xml` or your `dependencyManagement` section of your `build.gradle`.
198201

199202
[tabs]
200203
======
@@ -235,6 +238,9 @@ dependencyManagement {
235238
----
236239
======
237240

241+
[TIP]
242+
Spring provides a https://github.com/spring-gradle-plugins/dependency-management-plugin[`Dependency Management Plugin`] for Gradle
243+
238244
The preceding example ensures that all the transitive dependencies of Spring Security use the Spring {spring-core-version} modules.
239245

240246
[NOTE]
@@ -243,9 +249,11 @@ This approach uses Maven's "`bill of materials`" (BOM) concept and is only avail
243249
For additional details about how dependencies are resolved, see https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html[Maven's Introduction to the Dependency Mechanism documentation].
244250
====
245251

246-
[[maven-gradle-gearepositories]]
247-
=== Maven and Gradle Repositories
248-
All GA releases (that is, versions ending in .RELEASE) are deployed to Maven Central, so you need not declare additional Maven repositories in your `pom.xml` or, for Gradle, using the `mavenCentral()` repository is sufficient for GA releases.
252+
[[maven-gearepositories]]
253+
=== Maven Repositories
254+
All GA releases (that is, versions ending in .RELEASE) are deployed to Maven Central, so you need not declare additional Maven repositories in your `pom.xml`.
255+
256+
For Gradle using the `mavenCentral()` repository is sufficient for GA releases.
249257

250258
.build.gradle
251259
[source,groovy]

0 commit comments

Comments
 (0)