Add src/main/groovy to Java Build Path
- Create the src/main/groovy directory
- Right-click the project in Package Explorer, then click Properties
- Click Java Build Path in the left sidebar
- Click Add Folder... to add src/main/groovy
Add Groovy libraries to classpath
- Right-click the project in Package Explorer
- Expand Groovy, then click Add Groovy libraries to classpath
Only include groovy-all
At this point, trying to run the Spring Boot app will generate errors that look like this.
...
org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
...
The errors can be resolved by removing the extra libraries STS automatically added in the previous step.
- Right-click Groovy Libraries in the project
- Click Properties
- Select "No, only include groovy-all" in the first panel that asks, "Should all jars in the groovy-eclipse lib folder be included on the classpath?"