Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project xxx: Fatal error compiling
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin>
因为因为了这个,需要创建一个spring-boot启动类 启动类需要加上 @SpringBootApplication注解
import java.util.Collections; import java.util.Collections; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Application { public static void main(String[] args) { // Read environment variables String port = System.getenv("PORT"); if (port == null) { port = "8080"; } SpringApplication app = new SpringApplication(Application.class); app.setDefaultProperties(Collections.singletonMap("server.port", port)); app.run(args); } }