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.
Please don't report security vulnerabilities using GitHub issues, instead head over to https://spring.io/security-policy and learn how to disclose them responsibly.
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].
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.
Active contributors might be asked to join the core team, and given the ability to merge pull requests.
None of these is essential for a pull request, but they will all help.
They can also be added after the original pull request but before a merge.
* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project to apply code formatting conventions.
If you use Eclipse and you follow the '`Importing into eclipse`' instructions below you should get project specific formatting automatically.
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`.
* The build includes checkstyle rules for many of our code conventions.
Run `./mvnw validate` if you want to check you changes are compliant.
* 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.
* Add the ASF license header comment to all new `.java` files (copy from existing files in the project).
* Add yourself as an `@author` to the `.java` files that you modify substantially (more than cosmetic changes).
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.
We use the https://eclipse.org/m2e/[M2Eclipse] Eclipse plugin for Maven support.
Other IDEs and tools should also work without issue.
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`.
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.
You can import the Spring Boot code into any Eclipse 2019-12-based distribution.
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).
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).
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.
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.
_Not doing so could mean the import fails silently, leaving the project setup incomplete._
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.
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`.
If you encounter build failures running the integration tests, check the `build.log` file in the appropriate smoke test directory.