You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.adoc
+62-98Lines changed: 62 additions & 98 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,90 +1,67 @@
1
1
= Contributing to Spring Boot
2
2
3
-
Spring Boot is released under the Apache 2.0 license. If you would like to contribute
4
-
something, or want to hack on the code this document should help you get started.
3
+
Spring Boot is released under the Apache 2.0 license. If you would like to contribute something, or want to hack on the code this document should help you get started.
5
4
6
5
7
6
8
7
== Code of Conduct
9
-
This project adheres to the Contributor Covenant link:CODE_OF_CONDUCT.adoc[code of
10
-
conduct]. By participating, you are expected to uphold this code. Please report
This project adheres to the Contributor Covenant link:CODE_OF_CONDUCT.adoc[code of conduct].
9
+
By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].
12
10
13
11
14
12
15
13
== Using GitHub Issues
16
-
We use GitHub issues to track bugs and enhancements. If you have a general usage question
17
-
please ask on https://stackoverflow.com[Stack Overflow]. The Spring Boot team and the
18
-
broader community monitor the https://stackoverflow.com/tags/spring-boot[`spring-boot`]
19
-
tag.
14
+
We use GitHub issues to track bugs and enhancements.
15
+
If you have a general usage question please ask on https://stackoverflow.com[Stack Overflow].
16
+
The Spring Boot team and the broader community monitor the https://stackoverflow.com/tags/spring-boot[`spring-boot`] tag.
20
17
21
-
If you are reporting a bug, please help to speed up problem diagnosis by providing as
22
-
much information as possible. Ideally, that would include a small sample project that
23
-
reproduces the problem.
18
+
If you are reporting a bug, please help to speed up problem diagnosis by providing as much information as possible.
19
+
Ideally, that would include a small sample project that reproduces the problem.
24
20
25
21
26
22
27
23
== Reporting Security Vulnerabilities
28
-
If you think you have found a security vulnerability in Spring Boot please *DO NOT*
29
-
disclose it publicly until we've had a chance to fix it. Please don't report security
30
-
vulnerabilities using GitHub issues, instead head over to https://pivotal.io/security and
31
-
learn how to disclose them responsibly.
24
+
If you think you have found a security vulnerability in Spring Boot please *DO NOT* disclose it publicly until we've had a chance to fix it.
25
+
Please don't report security vulnerabilities using GitHub issues, instead head over to https://tanzu.vmware.com/security and learn how to disclose them responsibly.
32
26
33
27
34
28
35
29
== Sign the Contributor License Agreement
36
-
Before we accept a non-trivial patch or pull request we will need you to
37
-
https://cla.pivotal.io/sign/spring[sign the Contributor License Agreement].
38
-
Signing the contributor's agreement does not grant anyone commit rights to the main
39
-
repository, but it does mean that we can accept your contributions, and you will get an
40
-
author credit if we do. Active contributors might be asked to join the core team, and
41
-
given the ability to merge pull requests.
30
+
Before we accept a non-trivial patch or pull request we will need you to https://cla.pivotal.io/sign/spring[sign the Contributor License Agreement].
31
+
Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do.
32
+
Active contributors might be asked to join the core team, and given the ability to merge pull requests.
42
33
43
34
44
35
45
36
== Code Conventions and Housekeeping
46
-
None of these is essential for a pull request, but they will all help. They can also be
47
-
added after the original pull request but before a merge.
48
-
49
-
* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project
50
-
to apply code formatting conventions. If you use Eclipse and you follow the '`Importing
51
-
into eclipse`' instructions below you should get project specific formatting
52
-
automatically. You can also install the https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ Plugin]
53
-
or format the code from the Maven build by running
* The build includes checkstyle rules for many of our code conventions. Run
56
-
`./mvnw validate` if you want to check you changes are compliant.
57
-
* Make sure all new `.java` files have a Javadoc class comment with at least an
58
-
`@author` tag identifying you, and preferably at least a paragraph on what the class is
59
-
for.
60
-
* Add the ASF license header comment to all new `.java` files (copy from existing files
61
-
in the project)
62
-
* Add yourself as an `@author` to the `.java` files that you modify substantially (more
63
-
than cosmetic changes).
37
+
None of these is essential for a pull request, but they will all help.
38
+
They can also be added after the original pull request but before a merge.
39
+
40
+
* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project to apply code formatting conventions.
41
+
If you use Eclipse and you follow the '`Importing into eclipse`' instructions below you should get project specific formatting automatically.
42
+
You can also install the https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ Plugin] or format the code from the Maven build by running `./mvnw io.spring.javaformat:spring-javaformat-maven-plugin:apply`.
43
+
* The build includes checkstyle rules for many of our code conventions.
44
+
Run `./mvnw validate` if you want to check you changes are compliant.
45
+
* Make sure all new `.java` files have a Javadoc class comment with at least an `@author` tag identifying you, and preferably at least a paragraph on what the class is for.
46
+
* Add the ASF license header comment to all new `.java` files (copy from existing files in the project).
47
+
* Add yourself as an `@author` to the `.java` files that you modify substantially (more than cosmetic changes).
64
48
* Add some Javadocs.
65
49
* A few unit tests would help a lot as well -- someone has to do it.
66
-
* If no-one else is using your branch, please rebase it against the current master (or
67
-
other target branch in the main project).
68
-
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
69
-
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
70
-
message (where `XXXX` is the issue number).
50
+
* If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).
51
+
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions].
71
52
72
53
73
54
74
55
== Working with the Code
75
-
If you don't have an IDE preference we would recommend that you use
76
-
https://spring.io/tools/sts[Spring Tools Suite] or
77
-
https://eclipse.org[Eclipse] when working with the code. We use the
78
-
https://eclipse.org/m2e/[M2Eclipse] eclipse plugin for maven support. Other IDEs and tools
79
-
should also work without issue.
56
+
If you don't have an IDE preference we would recommend that you use https://spring.io/tools/sts[Spring Tools Suite] or https://eclipse.org[Eclipse] when working with the code.
57
+
We use the https://eclipse.org/m2e/[M2Eclipse] Eclipse plugin for Maven support.
58
+
Other IDEs and tools should also work without issue.
80
59
81
60
82
61
83
62
=== Building from Source
84
-
Spring Boot source can be built from the command line using
85
-
https://maven.apache.org/run-maven/index.html[Apache Maven] on JDK 1.8 or above. We
86
-
include '`Maven Wrapper`' scripts (`./mvnw` or `mvnw.bat`) that you can run rather than
87
-
needing to install Maven locally.
63
+
Spring Boot source can be built from the command line using https://maven.apache.org/run-maven/index.html[Apache Maven] on JDK 1.8 or above.
64
+
We include '`Maven Wrapper`' scripts (`./mvnw` or `mvnw.bat`) that you can run rather than needing to install Maven locally.
88
65
89
66
90
67
@@ -96,11 +73,9 @@ The project can be built from the root directory using the standard Maven comman
96
73
$ ./mvnw clean install
97
74
----
98
75
99
-
NOTE: You may need to increase the amount of memory available to Maven by setting
100
-
a `MAVEN_OPTS` environment variable with the value `-Xmx512m`
76
+
NOTE: You may need to increase the amount of memory available to Maven by setting a `MAVEN_OPTS` environment variable with the value `-Xmx512m`.
101
77
102
-
If you are rebuilding often, you might also want to skip the tests and the execution of
103
-
checkstyle until you are ready to submit a pull request:
78
+
If you are rebuilding often, you might also want to skip the tests and the execution of checkstyle until you are ready to submit a pull request:
104
79
105
80
[indent=0]
106
81
----
@@ -117,16 +92,13 @@ You can run a full build using the following command:
117
92
$ ./mvnw -Pfull clean install
118
93
----
119
94
120
-
NOTE: As for the standard build, you may need to increase the amount of memory available
121
-
to Maven by setting a `MAVEN_OPTS` environment variable with the value `-Xmx512m`. We
122
-
generate more artifacts when running the full build (such as Javadoc jars), so you may
123
-
find the process a little slower than the standard build.
95
+
NOTE: As for the standard build, you may need to increase the amount of memory available to Maven by setting a `MAVEN_OPTS` environment variable with the value `-Xmx512m`.
96
+
We generate more artifacts when running the full build (such as Javadoc jars), so you may find the process a little slower than the standard build.
124
97
125
98
[TIP]
126
99
====
127
-
If you want to run a build without the smoke tests and integration tests, building the
128
-
`spring-boot-project` module is enough. You can cd there and run the same command, or you
129
-
can run this from the top-level directory:
100
+
If you want to run a build without the smoke tests and integration tests, building the `spring-boot-project` module is enough.
101
+
You can cd there and run the same command, or you can run this from the top-level directory:
130
102
131
103
[indent=0]
132
104
----
@@ -137,9 +109,8 @@ can run this from the top-level directory:
137
109
138
110
139
111
=== Importing into Eclipse
140
-
You can import the Spring Boot code into any Eclipse 2019-12-based distribution. The
141
-
easiest way to setup a new environment is to use the Eclipse Installer with the provided
142
-
`spring-boot-project.setup` file (in the `/eclipse` folder).
112
+
You can import the Spring Boot code into any Eclipse 2019-12-based distribution.
113
+
The easiest way to setup a new environment is to use the Eclipse Installer with the provided `spring-boot-project.setup` file (in the `/eclipse` folder).
143
114
144
115
145
116
@@ -150,7 +121,8 @@ To use the installer:
150
121
* Download and run the latest https://download.eclipse.org/justj/?file=oomph/products/latest[Eclipse Installer] (must be 1.19.0 or above).
151
122
* Switch to "Advanced Mode" using the drop down menu on the right.
152
123
* Select "`Eclipse IDE for Java Developers`" under "`Eclipse.org`" as the product to install, `2020-12` as the product version, and click "`next`".
153
-
* For the "`Project`" click on "`+`" to add a new setup file. Select "`Github Projects`" and browse for `<checkout>/eclipse/spring-boot-project.setup` from your locally cloned copy of the source code.
124
+
* For the "`Project`" click on "`+`" to add a new setup file.
125
+
Select "`Github Projects`" and browse for `<checkout>/eclipse/spring-boot-project.setup` from your locally cloned copy of the source code.
154
126
Click "`OK`" to add the setup file to the list.
155
127
* Double-click on "`Spring Boot`" from the project list to add it to the list that will be provisioned then click "`Next`".
156
128
* Click show all variables and make sure that "`Checkout Location`" points to the locally cloned source code that you selected earlier.
@@ -162,17 +134,16 @@ Projects will be grouped into working-sets to make the code easier to navigate.
162
134
163
135
If you want to work on the `spring-boot-gradle-plugin` you should remove the imported Maven project and reimport it as a Gradle project.
164
136
165
-
TIP: If you see import errors with `com.sun` packages make sure you have setup a valid `JavaSE-1.8` environment. From preferences select "`Java`", "`Installed JREs`", "`Execution Environments`" and make sure "`JavaSE-1.8`" points to a Java 1.8 install (we use AdoptOpenJDK on our CI).
137
+
TIP: If you see import errors with `com.sun` packages make sure you have setup a valid `JavaSE-1.8` environment.
138
+
From preferences select "`Java`", "`Installed JREs`", "`Execution Environments`" and make sure "`JavaSE-1.8`" points to a Java 1.8 install (we use AdoptOpenJDK on our CI).
166
139
167
140
168
141
169
142
==== Manual Installation with M2Eclipse
170
-
If you prefer to install Eclipse yourself you should use the
171
-
https://eclipse.org/m2e/[M2Eclipse] eclipse plugin. If you don't already have m2eclipse
172
-
installed it is available from the "`Eclipse marketplace`".
143
+
If you prefer to install Eclipse yourself you should use the https://eclipse.org/m2e/[M2Eclipse] eclipse plugin.
144
+
If you don't already have m2eclipse installed it is available from the "`Eclipse marketplace`".
173
145
174
-
Spring Boot includes project specific source formatting settings, in order to have these
175
-
work with m2eclipse, we provide an additional Eclipse plugin that you can install:
146
+
Spring Boot includes project specific source formatting settings, in order to have these work with m2eclipse, we provide an additional Eclipse plugin that you can install.
176
147
177
148
178
149
@@ -181,30 +152,25 @@ work with m2eclipse, we provide an additional Eclipse plugin that you can instal
181
152
* Add `https://dl.bintray.com/spring/javaformat-eclipse/` as a site.
182
153
* Install "Spring Java Format".
183
154
184
-
NOTE: The plugin is optional. Projects can be imported without the plugins, your code
185
-
changes just won't be automatically formatted.
155
+
NOTE: The plugin is optional.
156
+
Projects can be imported without the plugins, your code changes just won't be automatically formatted.
186
157
187
-
With the requisite eclipse plugins installed you can select
188
-
`import existing maven projects` from the `file` menu to import the code. You will
189
-
need to import the root `spring-boot` pom and the `spring-boot-smoke-tests` pom separately.
158
+
With the requisite eclipse plugins installed you can select `import existing maven projects` from the `file` menu to import the code.
159
+
You will need to import the root `spring-boot` pom and the `spring-boot-smoke-tests` pom separately.
190
160
191
161
192
162
193
163
=== Importing into IntelliJ IDEA
194
164
**Please, do this first!**
195
-
Go to `Preferences | Build, Execution, Deployment | Build Tools | Maven | Importing`
196
-
and set `VM options for importer` to `-Xmx2g` to allocate sufficient memory for IDEA's
197
-
Maven import process to parse the Spring Boot project structure. _Not doing so could
198
-
mean the import fails silently, leaving the project setup incomplete._
165
+
Go to `Preferences | Build, Execution, Deployment | Build Tools | Maven | Importing` and set `VM options for importer` to `-Xmx2g` to allocate sufficient memory for IDEA's Maven import process to parse the Spring Boot project structure.
166
+
_Not doing so could mean the import fails silently, leaving the project setup incomplete._
199
167
200
-
For the actual import use "`File`" -> "`Open`" and select the root `pom.xml`, or the
201
-
`spring-boot-project/pom.xml` if you only want the Spring Boot project sources.
168
+
For the actual import use "`File`" -> "`Open`" and select the root `pom.xml`, or the `spring-boot-project/pom.xml` if you only want the Spring Boot project sources.
202
169
203
170
204
171
205
172
==== Install the Spring Formatter plugin
206
-
If you haven't done so, install the formatter plugin so that proper formatting rules are
207
-
applied automatically when you reformat code in the IDE.
173
+
If you haven't done so, install the formatter plugin so that proper formatting rules are applied automatically when you reformat code in the IDE.
208
174
209
175
* Download the latest https://search.maven.org/search?q=g:io.spring.javaformat%20AND%20a:spring-javaformat-intellij-plugin[IntelliJ IDEA plugin].
210
176
* Select "`IntelliJ IDEA`" -> "`Preferences`".
@@ -215,8 +181,7 @@ applied automatically when you reformat code in the IDE.
215
181
216
182
217
183
==== Import additional code style
218
-
The formatter does not cover all rules (such as order of imports) and an additional file
219
-
needs to be added.
184
+
The formatter does not cover all rules (such as order of imports) and an additional file needs to be added.
220
185
221
186
* Select "`IntelliJ IDEA`" -> "`Preferences`".
222
187
* Select "`Editor`" -> "`Code Style`".
@@ -226,22 +191,21 @@ needs to be added.
226
191
227
192
228
193
=== Importing into Other IDEs
229
-
Maven is well supported by most Java IDEs. Refer to your vendor documentation.
194
+
Maven is well supported by most Java IDEs.
195
+
Refer to your vendor documentation.
230
196
231
197
232
198
233
199
== Integration Tests
234
200
The smoke tests run as part of the build when you `./mvnw install`.
235
-
Due to the fact that they make use of the `spring-boot-maven-plugin`
236
-
they cannot be called directly, and so instead are launched via the
237
-
`maven-invoker-plugin`. If you encounter build failures running the integration tests,
238
-
check the `build.log` file in the appropriate smoke test directory.
201
+
Due to the fact that they make use of the `spring-boot-maven-plugin` they cannot be called directly, and so instead are launched via the `maven-invoker-plugin`.
202
+
If you encounter build failures running the integration tests, check the `build.log` file in the appropriate smoke test directory.
203
+
239
204
240
205
241
206
== Cloning the git repository on Windows
242
-
Some files in the git repository may exceed the Windows maximum file path (260
243
-
characters), depending on where you clone the repository. If you get `Filename too long`
244
-
errors, set the `core.longPaths=true` git option:
207
+
Some files in the git repository may exceed the Windows maximum file path (260 characters), depending on where you clone the repository.
208
+
If you get `Filename too long` errors, set the `core.longPaths=true` git option:
0 commit comments