关于idea:IDEA入门教程

12次阅读

共计 4898 个字符,预计需要花费 13 分钟才能阅读完成。

IDEA 入门教程

  1. 装置及下载

=========

下载地址:
https://www.jetbrains.com/idea/
至于社区版 / 还是商业版自行决定

2. 创立我的项目

2.1 创立 JT 我的项目

2.2 抉择 maven

2.3 抉择 jar 包版本

2.4 我的项目初始化格局

  1. IDEA 配置

==========

3.1 装置汉化插件 (选装)

对于初学者, 好多 IDEA 的配置, 都是英文不是特地相熟. 因而官网提供了汉化补丁, 从此应用无压力 , 个人感觉好用.
蕴含 chinese 和 lombok 都装置一下. 装置好之后重启 IDEA 即可.

3.2 配置键位

设定快捷键的键位 抉择 eclipse

3.3 设定字母大小

3.4 匹配大小写提醒

3.5 设置主动编译

3.6 配置 maven


3.7 设置主动保留

3.8 构造方法提醒

4. 配置京淘我的项目

4.1 配置父级我的项目 jt

4.1.1 批改 POM.xml 文件

4.1.2 增加 jar 包文件

`<!-- 利用 parent 标签,springBoot 我的项目整合了其余框架的包及具体的配置都在 parent 中进行了定义. 定义了版本包信息. -->
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.2.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <!-- 以后 maven 配置信息 -->
    <properties>
        <java.version>1.8</java.version>
        <!-- 指定 maven 插件版本 -->
        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
        <!-- 跳过测试类打包 -->
        <skipTests>true</skipTests>
    </properties>

    <!-- 我的项目的依赖信息. Maven: jar 包具备依赖性 A ~~~~ B ~~~~~C 导入 A 时 BC 都会主动导入. -->

    <dependencies>
        <dependency>
            <!-- 组 ID: 个别公司域名倒写 -->
            <groupId>org.springframework.boot</groupId>
            <!-- 项目名称 -->
            <!--SpringMVC 的配置信息 jar 配置文件 开箱即用的成果 定义 -->
            <artifactId>spring-boot-starter-web</artifactId>
            <!-- 我的项目版本号 -->
            <!-- <version> 父级中进行了定义 </version> -->
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- 增加属性注入 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- 反对热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>

        <!-- 引入插件 lombok 主动的 set/get/ 构造方法插件 -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

        <!-- 引入数据库驱动 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!--springBoot 数据库连贯 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>

        <!--spring 整合 mybatis-plus -->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.2.0</version>
        </dependency>

        <!--springBoot 整合 JSP 增加依赖 -->
        <!--servlet 依赖 -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>

        <!--jstl 依赖 -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>

        <!-- 使 jsp 页面失效 -->
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>

        <!-- 增加 httpClient jar 包 -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>

        <!-- 引入 dubbo 配置 -->
        <!--
            <dependency>
                <groupId>com.alibaba.boot</groupId>
                <artifactId>dubbo-spring-boot-starter</artifactId>
                version>0.2.0</version>
            </dependency>
        -->

        <!-- 增加 Quartz 的反对 -->
        <!-- <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-quartz</artifactId>
        </dependency> -->

        <!-- 引入 aop 反对 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>

        <!--spring 整合 redis -->
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
        </dependency>
    </dependencies>` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22
*   23
*   24
*   25
*   26
*   27
*   28
*   29
*   30
*   31
*   32
*   33
*   34
*   35
*   36
*   37
*   38
*   39
*   40
*   41
*   42
*   43
*   44
*   45
*   46
*   47
*   48
*   49
*   50
*   51
*   52
*   53
*   54
*   55
*   56
*   57
*   58
*   59
*   60
*   61
*   62
*   63
*   64
*   65
*   66
*   67
*   68
*   69
*   70
*   71
*   72
*   73
*   74
*   75
*   76
*   77
*   78
*   79
*   80
*   81
*   82
*   83
*   84
*   85
*   86
*   87
*   88
*   89
*   90
*   91
*   92
*   93
*   94
*   95
*   96
*   97
*   98
*   99
*   100
*   101
*   102
*   103
*   104
*   105
*   106
*   107
*   108
*   109
*   110
*   111
*   112
*   113
*   114
*   115
*   116
*   117
*   118
*   119
*   120
*   121
*   122
*   123
*   124
*   125
*   126
*   127
*   128
*   129
*   130
*   131
*   132
*   133
*   134
*   135
*   136
*   137

4.2 创立 jt-common 我的项目

4.2.1 创立新模块

4.2.2 抉择我的项目类型默认 jar 包


4.2.3 导入 jt-common 我的项目

4.3 创立 jt-manager 我的项目

4.3.1 创立我的项目

4.3.2 创立 jt-manager 我的项目

4.3.3 批改打包形式 / 增加依赖信息 / 增加插件

 `<parent>
        <artifactId>jt</artifactId>
        <groupId>com.jt</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>jt-manager</artifactId>
    <packaging>war</packaging>

    <!-- 增加依赖信息 -->
    <dependencies>
        <dependency>
            <groupId>com.jt</groupId>
            <artifactId>jt-common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

    <!-- 增加插件 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22
*   23
*   24
*   25
*   26
*   27

4.3.4 导入 jt-manager src 文件

阐明: 将课前原有我的项目中的 src 文件导入即可

4.3.5 配置启动项


4.3.6 启动成果测试

4.3.7 将 jt-common 打包

5. 对于 IDEA 配置

5.1 对于 IDEA Bean 主动注入报错阐明

批改 IDEA 数据校验 将√号去除即可.

中文版配置如图.

5.2 IDEA 热部署配置

1. 批改主动保留配置

2. 增加主动配置注册
ctrl +alt + shift +/ 快捷键 调出注册操作

3. 将主动注册打钩.

5.3 IDEA 快捷键设定

5.3 IDEA 插件装置

5.3.1 插件官网

url : https://plugins.jetbrains.com/

5.3.2 手动搜寻插件

5.3.2 手动导入插件

6 LOMBOK 引入问题

6.1 装置插件

6.2 查看 LOMBOK 包是否下载失常

6.3 启动注解解决

正文完
 0