myeclipse使用maven搭建springboot

 时间:2024-11-04 01:10:32

1、首先引入springboot-starter父项工程。<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>

myeclipse使用maven搭建springboot

3、加入springboot打包插件配置。<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>

myeclipse使用maven搭建springboot

5、建立一个REST风格的控制类:package com.gwolf.controller;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;@Controllerpublic class HelloController { @ResponseBody @RequestMapping("/hello") public String hello() { return "hello World!"; }}

myeclipse使用maven搭建springboot

7、启动主程序类,我们可以通过浏览器地址直接访问到我们控制器的代码了。

  • idea自动生成构造方法
  • CentOS7 64位安装mysql教程
  • eclipse中jar包如何导入/移除项目?
  • Xampp安装及使用
  • JSON的基本格式有哪些?
  • 热门搜索
    湖南长沙旅游景点大全 南京周边旅游景点 新西兰打工旅游签证 杭州黄龙旅游集散中心 发现旅游 长岛旅游网 上海旅游节半价景点 印尼巴厘岛旅游攻略 贵港旅游景点大全 美国旅游签证有效期