码迷,mamicode.com
首页 > 编程语言 > 详细

在eclipse中安装maven和spring boot

时间:2017-04-14 22:36:32      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:plugins   images   ima   new   pid   tar   help   ica   war   

在eclipse中安装maven和spring boot

   1.打开help->install new software

   2.点Add,Name(maven),Location(http://download.eclipse.org/technology/m2e/releases),OK,select然后next到安装中,等待安装完成。

技术分享

   3.新建maven项目

  File->New->Project, 选择Maven Project

 技术分享

  next到

 技术分享

  输入artifact id(项目名)、group id(项目域名,com.XXX),finish。

  4.点击pom.xml->底下的pom.xml,在对应位置插入下文中代码。

 <!-- 设置maven的jdk版本为1.8 -->
  <build>  
    <plugins>  
        <plugin>  
            <groupId>org.apache.maven.plugins</groupId>  
            <artifactId>maven-compiler-plugin</artifactId>  
            <configuration>  
                <source>1.8</source>  
                <target>1.8</target>  
            </configuration>  
        </plugin>  
    </plugins>  
</build>

技术分享

技术分享

 

技术分享

 

  5.进入http://projects.spring.io/spring-boot/,拷贝以下代码,插入到pom.xml的对应位置。

  注意将版本改为1.5.1,如图:

技术分享

技术分享

  保存pom.xml

  6.在此目录下新建一个类,命名为SampleController

技术分享

技术分享

  7.进入http://projects.spring.io/spring-boot/,插入代码如图:

技术分享

  保存,右击代码区选择run as->Java Application.

  8.打开浏览器输入http://localhost:8080/,出现Hello World!,完成。

技术分享

 

在eclipse中安装maven和spring boot

标签:plugins   images   ima   new   pid   tar   help   ica   war   

原文地址:http://www.cnblogs.com/ZYTZ/p/6710702.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!