<profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile>
<!--国内中央仓库配置-阿里云中央仓库 --> <mirror> <id>nexus-aliyun</id> <mirrorOf>*</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror>
2.在eclipse新建个Maven工程,File-->New-->Other...-->查找Maven-->Maven Project-->Next
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.9.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>
server.port=8081
把端口改为8081,避免与Tomcat运行出现端口被占用问题
package com.xdr.spring; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /* * springboot启动类(引导类) */ @SpringBootApplication //表明当前类是springboot的引导类 public class Application { public static void main(String[] args) { System.out.println("启动springboot"); SpringApplication.run(Application.class, args); } }
最后启动项目,运行出
说明springboot项目运行成功了。