60 lines
2.5 KiB
Markdown
60 lines
2.5 KiB
Markdown
# Contributing to Spring REST Docs
|
|
|
|
Spring REST Docs is released under the Apache 2.0 license.
|
|
If you would like to contribute something, or simply want to work with the code, this document should help you to get started.
|
|
|
|
## Code of conduct
|
|
|
|
This project adheres to the Contributor Covenant [code of conduct][1]. By participating, you are expected to uphold this code.
|
|
Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
|
|
|
|
## Include a Signed-off-by Trailer
|
|
|
|
All commits must include a _Signed-off-by_ trailer at the end of each commit message to indicate that the contributor agrees to the [Developer Certificate of Origin (DCO)](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin).
|
|
For additional details, please refer to the ["Hello DCO, Goodbye CLA: Simplifying Contributions to Spring"](https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring) blog post.
|
|
|
|
## Code conventions and housekeeping
|
|
|
|
None of these is essential for a pull request, but they will all help
|
|
|
|
- Make sure all new `.java` files to have a simple 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)
|
|
- Add some Javadocs
|
|
- Add unit tests that covers and new or modified functionality
|
|
- Whenever possible, please rebase your branch against the current main (or other target branch in the project)
|
|
- When writing a commit message please follow [these conventions][3]
|
|
Also, if you are fixing an existing issue please add `Fixes gh-nnn` at the end of the commit message (where nnn is the issue number)
|
|
|
|
## Working with the code
|
|
|
|
### Building from source
|
|
|
|
To build the source you will need Java 17 or later.
|
|
The code is built with Gradle:
|
|
|
|
```
|
|
$ ./gradlew build
|
|
```
|
|
|
|
To build the samples, run the following command:
|
|
|
|
```
|
|
$ ./gradlew buildSamples
|
|
```
|
|
|
|
### Importing into Eclipse
|
|
|
|
The project has Gradle's Eclipse plugin applied.
|
|
Eclipse project and classpath metadata can be generated by running the `eclipse` task:
|
|
|
|
```
|
|
$ ./gradlew eclipse
|
|
```
|
|
|
|
The project can then be imported into Eclipse using `File -> Import…` and then selecting `General -> Existing Projects into Workspace`.
|
|
|
|
[1]: CODE_OF_CONDUCT.md
|
|
[2]: https://cla.pivotal.io/sign/spring
|
|
[3]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|