I followed the instructions in Spring Boot Support in Spring Tool Suite 3.6.4 and ended up with an Eclipse project which has several issues. The number one issue is that when I right-click on the class containing the "main" entry method and select the "Run As" option, the only entry I get is the fallback "Run Configurations..." method. I neither get the option to run it as a "Spring Boot App" or as a "Java Application".
My question is how do I create the project or what do I do after it's created following the instructions in that site to get that Run As option?
In addition to the above information, I should add the following:
- I'm using Eclipse 4.4.2 (Luna SR2) and STS 3.7.1
- I've tried it on both Windows and Linux (Fedora with OpenJDK)
- Used Java 8 (Sun Hotspot 64-bit 1.8.0_65)
When the pom.xml initially gets created, it has an error apparently due to a missing config the m2e wants for which I needed to add the following:
<pluginManagement> <plugins> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <versionRange>[3.1,)</versionRange> <goals> <goal>compile</goal> <goal>testCompile</goal> </goals> </pluginExecutionFilter> <action> <ignore /> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement>
It doesn't look like the Eclise project is properly configured for a Java application either. There's no configuration for a Java src tree. Below is the .project file:
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>demo</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.m2e.core.maven2Builder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.m2e.core.maven2Nature</nature> </natures> </projectDescription>
- I can manually run the app as per How to run Spring Boot web application in Eclipse itself? (by executing [Project] --> Run As --> Maven Build... --> Goal: spring-boot:run