Transparency is one of our core values, and we encourage developers to contribute and become part of the SparkPost developer community.
The following is a set of guidelines for contributing to java-sparkpost, which is hosted in the SparkPost Organization on GitHub. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
- You can create an issue here, but before doing that please read the notes below on debugging and submitting issues, and include as many details as possible with your report.
- Include the version of java-sparkpost you are using.
- Perform a cursory search to see if a similar issue has already been submitted.
-
Download and install Java JDK >= 1.7
-
Download and setup Maven >= 3.3
-
Setup an account at SparkPost.com
-
Create API Key in your SparkPost Account
-
For examples to run you will need to setup the following environment variables:
SPARKPOST_API_KEY="YOUR_SPARKPOST_API_KEY"
SPARKPOST_SENDER_EMAIL="YOUR_EMAIL_FROM_ADDRESS"
-
Optionally setup Eclipse (will need Maven Plugin to import project)
-
Optionally setup IntelliJ
-
Clone the repository
git clone https://github.com/sparkpost/java-sparkpost
-
Build with Maven
mvn clean install
It is easiest if you build the project on the command-line first before importing project into Eclipse.
- Import project into Eclipse
- Setup Lombok in Eclipse
./tools/bin/setupLombok.sh
(browse to and select eclipse.ini) - Restart Eclipse
- File -> Import -> Maven -> Existing Maven Projects
- See "Prerequisites" above for environment variables needed for running examples
- Setup Lombok in Eclipse
- Import project into IntelliJ
- File -> New -> Project from Existing Sources
- Download and install the Lombok plugin https://plugins.jetbrains.com/plugin/6317
- Provide documentation for any newly added code.
- Provide tests for any newly added code.
- Follow Google Style Guide
- Create a new branch named after the issue you’ll be fixing (include the issue number as the branch name, example: Issue in GH is #8 then the branch name should be ISSUE-8))
- Write corresponding tests and code (only what is needed to satisfy the issue and tests please)
- Include your tests in the 'test' directory in an appropriate test file
- Write code to satisfy the tests
- Ensure automated tests pass
- Submit a new Pull Request applying your feature/fix branch to the develop branch
Once you are set up for local development:
- Run
mvn clean install
to test against your current environment