Appendices

Appendix A: Building

A.1. Basic Compile and Test

To build the source you will need to install JDK 1.8.spring-doc.cn

The build uses the Maven wrapper so you don’t have to install a specific version of Maven. To enable the tests, you should have RabbitMQ server running on localhost and the default port (5672) before building.spring-doc.cn

The main build command isspring-doc.cn

$ ./mvnw clean install

You can also add '-DskipTests' if you like, to avoid running the tests.spring-doc.cn

You can also install Maven (>=3.3.3) yourself and run the mvn command in place of ./mvnw in the examples below. If you do that you also might need to add -P spring if your local Maven settings do not contain repository declarations for spring pre-release artifacts.
Be aware that you might need to increase the amount of memory available to Maven by setting a MAVEN_OPTS environment variable with a value like -Xmx512m -XX:MaxPermSize=128m. We try to cover this in the .mvn configuration, so if you find you have to do it to make a build succeed, please raise a ticket to get the settings added to source control.

The projects that require middleware generally include a docker-compose.yml, so consider using Docker Compose to run the middeware servers in Docker containers.spring-doc.cn

A.2. Documentation

There is a "docs" profile that will generate documentation.spring-doc.cn

./mvnw clean package -Pdocs -DskipTestsspring-doc.cn

The reference documentation can then be found in docs/target/contents/reference.spring-doc.cn

A.3. Working with the code

If you don’t have an IDE preference we would recommend that you use Spring Tools Suite or Eclipse when working with the code. We use the m2eclipe eclipse plugin for maven support. Other IDEs and tools should also work without issue.spring-doc.cn

A.3.1. Importing into eclipse with m2eclipse

We recommend the m2eclipe eclipse plugin when working with eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse marketplace".spring-doc.cn

Unfortunately m2e does not yet support Maven 3.3, so once the projects are imported into Eclipse you will also need to tell m2eclipse to use the .settings.xml file for the projects. If you do not do this you may see many different errors related to the POMs in the projects. Open your Eclipse preferences, expand the Maven preferences, and select User Settings. In the User Settings field click Browse and navigate to the Spring Cloud project you imported selecting the .settings.xml file in that project. Click Apply and then OK to save the preference changes.spring-doc.cn

Alternatively you can copy the repository settings from .settings.xml into your own ~/.m2/settings.xml.

A.3.2. Importing into eclipse without m2eclipse

If you prefer not to use m2eclipse you can generate eclipse project metadata using the following command:spring-doc.cn

$ ./mvnw eclipse:eclipse

The generated eclipse projects can be imported by selecting import existing projects from the file menu.spring-doc.cn