Pivotal recently released version 3.9.1 of its Spring Tool Suite (STS), the Eclipse-based IDE for developing applications in Spring Framework.
With this release, STS has been updated to Eclipse Oxygen.1a, which includes support for JDK 9 and JUnit 5 out of the box.
JDK 9
The Eclipse compiler for Java implements all the new Java 9 language enhancements. The IDE has added features to support Java Modules including compiler updates and search features.
The Eclipse documentation states that it is not mandatory to run Eclipse with a Java 9 runtime to get the Java 9 support. However, Java runtime 9 must be in build path to compile a modular project.
An existing non-modular project can be converted to a modular project by creating a module-info.java for the project.
Source: Eclipse documentation
A library or a container can be added to the module path instead of classpath.
Source: Eclipse documentation
Java search now includes a "Module" search scope.
Source: Eclipse documentation
JUnit 5
According to Eclipse Oxygen.1a documentation, JUnit 5 support includes
- Creation of new JUnit Jupiter test via New Junit Test Case wizard.
Source: Eclipse documentation - A developer can add JUnit 5 library to the build path.
- Create a JUnit Jupiter test method with the new
test_jupiter
template. - Create a
@TestFactory
method with the newtest_factory
template. - JUnit Jupiter's
Assertions
,Assumptions
,DynamicContainer
andDynamicTest
classes are now added to Eclipse Favorites by default. - You can provide tags to be included in or excluded from a test run in the Configure Tags dialog of JUnit launch configuration.
Consult the documentation for the complete list of features.
Eclipse documentation states that if a developer is running JUnit 5 tests via @RunWith(JUnitPlatform.class)
in Eclipse without JUnit 5 support, that means developer has JUnit 4 as the test runner in launch configurations. The developer should either change the test runner to JUnit 5 or delete them so that new launch configurations are created with JUnit 5 test runner while running the tests.
The documentation also notes:
We do not support running tests in a setup where an old Eclipse build (not having JUnit 5 support) is using a new Eclipse build (having JUnit 5 support) as target. Also, developers who have the JDT JUnit runtime bundles (org.eclipse.jdt.junit.runtime, org.eclipse.jdt.junit4.runtime)
checked out and pull the latest changes will run into the above issue. You are expected to use a new Eclipse build for the development.
Compatibility warning
STS has included a JDK9 compatibility warning for projects using Spring Boot 1.5.x or earlier that have a build plugin not compatible with Java 9. In those cases STS 3.9.1 documentation recommends running the IDE on JDK8. Developers can still configure Java 9 JRE and develop Java 9 applications but the IDE itself would run on top of Java 8 runtime.
New code templates
New code templates are added for meta annotations such as GetMapping
, PostMapping
, PutMapping
, and DeleteMapping
.
Source: STS Documentation
Other noteworthy enhancements
- macOS version of STS ships as DMG file
- Pivotal tc Server updated to 3.2.8
- Automatic conversion of boot property files to YAML
- Spring Cloud CLI is made completely user driven rather than auto-install.
- Experimental: use Spring Boot Thin JAR wrapper to launch boot apps.
According to Spring blog, STS 3.9.2 is scheduled to be released on top of Eclipse Oxygen.2 (4.7.2) in late December 2017.