Myeclipse 搭建SpringBoot

首页给myeclipse装上

maven 下载地址:https://maven.apache.org/download.cgi

新建Maven项目

130301_x7Nn_2724419.png

130402_WfMn_2724419.png

点击Next

130426_ctcY_2724419.png

填完之后点击Finish

130517_0Vyq_2724419.png

添加需要的pom

 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.itman.xw</groupId>
	<artifactId>test-springboot</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.3.0.RELEASE</version>
		<relativePath />
	</parent>
	<properties>
		<!-- 声明项目配置依赖编码格式为 utf-8 -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<!-- java jdk 版本声明 可变更 根据自己配置去匹配 -->
		<java.version>1.7</java.version>
		<maven.compiler.source>1.7</maven.compiler.source>
		<maven.compiler.target>1.7</maven.compiler.target>
		<fastjson.version>1.2.24</fastjson.version>
	</properties>

	<dependencies>
		<!-- 对web开发的支持,包括tomcat,spring-webmvc -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<!-- spring boot核心,包括自动配置支持,日志和YAML -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
		</dependency>
		<!-- DevTools in Spring Boot 项目热部署 -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<!-- spring boot maven插件,可以将项目打包成一个可执行的jar文件 -->
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

	<repositories>
		<repository>
			<id>aliyun-repos</id>
			<name>aliyun-repos</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>
</project>

新建一个类来启动springboot项目

131035_qAVg_2724419.png

 

131355_rmfK_2724419.png

131403_5RFU_2724419.png

在新建一个application.properties文件,用来配置SpringBoot的一些参数

131515_Fzil_2724419.png

启动运行java的main方法即可启动过SpringBoot(启动成功界面如下)

131554_5sHH_2724419.png

访问项目即可

131634_vbpJ_2724419.png

转载于:https://my.oschina.net/itmanxw/blog/862171

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值