Java

REVIEW

Here’s a list of our preferred technology choices when implementing in Java. We’re not prescriptive in these choices, but have a good reason to deviate from the norm. If you feel there’s a better option, raise it at the Developer Community.

Java language versions

Refer to the Release adoption schedule

Java projects must:

  • define the source and target Java version in the Maven pom.xml file
  • use a Java Version Manager such as JEnv to manage Java versions in development

IDE

Choose whatever you’re comfortable with, so long as you can perform your job. Our developers tend to select one of

Build

Application

Our standard Java application stack is built on the Spring ecosystem.

We generally use core Java and standard extension packages in preference to third party, although Spring is often used in preference where available:

  • Dates and Times using Java.time and not joda or java.util
  • Transactions using Java Transaction API (javax.transaction)
  • Object Relational Mapping using Java Persistence API (javax.persistence) backed by Hibernate ORM
  • Validation with JSR-303 (javax.validation) backed by Hibernate Validator

We also use other well known libraries:

Testing

  • JUnit 5 as our core testing framework
  • Prefer AssertJ for assertions over Hamcrest matchers
  • Mockito for mocking of downstream dependencies
  • Spring Test including MockMvc and DataJpaTest
  • Unit tests run within the Maven test phase with surefire plugin
  • Integrations tests run within the Maven integration-test phase with failsafe plugin.

Improve the playbook

If you spot anything factually incorrect with this page or have ideas for improvement, please share your suggestions.

Before you start, you will need a GitHub account. Github is an open forum where we collect feedback.