Spring Boot实战之项目搭建(二)

基于Intellij IDEA搭建

Intellij IDEA是Java最优秀的开发工具:功能全面,提示只能,开发不卡顿,新技术支持快。在业界对Intellij的好评也非常多,使用的人也不在少数,经常使用Eclipse的也可能会转向Intellij,所以我认为i对于使用Intellij来搭建Spring项目也是需要掌握。

Intellij IDEA下载

新建Maven项目。单机File→New→Project→Maven

新建Maven项目

输入包名、项目名

输入Maven项目坐标值

选择存储路径

存储路径

修改pom.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<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.xxgg</groupId>
    <artifactId>spring4_demo</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.1.6.RELEASE</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

项目结构

Intellij IDEA设置自动导入包

File→Settings→Editor→General→Auto Import
勾选Optimize imports on the fly和Add unambiguous imports on the fly
Optimize imports on the fly:自动去掉一些没有用到的包
Add unambiguous imports on the fly:自动帮我们优化导入的包

设置自动导入

依赖树查看

依赖树查看

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值