2

【版本2020.03】使用idea导入maven项目 - 一乐乐

 2 years ago
source link: https://www.cnblogs.com/shan333/p/16099454.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

心得1:不同版本的idea,一些选项的名称稍微有点不同,比如以前导入项目的选项名称都是import Project,但是我使用的版本是2020.03 导入项目的名称是 import Settings

心得2:版本2020.3 的idea 导入(maven)项目的方式和以前不同,可以直接在 File-> New -> Project from Existing Sources -> Project from Existing Sources -> Import project from external model -> 选择maven

心得3:导入项目失败,时间赶的,还有一种解决思路:【自己建立项目,手动拷贝源码+配置】可以自己创建对应版本的项目,然后拷贝从网上下载的项目的源码+配置文件

----------------本文是以导入springboot项目(maven)为例:

一、导入maven项目之前,删除掉不相关的,只留了源码src 和 配置文件pom 文件

image

★ 重点删除对象:项目中的.idea 和 .iml 文件,以及编译生成的class文件全部删除

■ 若是从官网下载的项目,例如从springboot官网下载的maven项目,因为它不是通过idea 工具开发的,也没有经过编译,不会有(.idea 和 .iml 文件,以及编译生成的class文件),但是它有一些版本相关的文件

image

■ 介绍一下 使用idea 工具开发,项目生成的 .idea 和 .iml 文件是什么?

.idea 对module 配置信息之意, infomation of module
.iml是 intellij idea的工程配置文件,里面是当前project的一些配置信息。
  • .idea:存放项目的配置信息。其中包括版本控制信息、历史记录等等。
  • .iml文件是开发工具idea自动创建的模块文件,用于Java应用开发,存储一些模块开发相关的信息,比如一个Java组件,插件组件, Maven组件等等,还可能会存储一些模块路径信息, 依赖信息以及别的一写设置。

二、将maven项目导入idea

1、选择 import Settings

(1)若是打开了某个项目,先退出去

image

(2)退出去,然后看到 import project 导入【注意版本:2020.03 退出去是没有 import project,而是 import settings(在欢迎界面全局设置设置一下 File 下面有import settings 选项)】

image

image

- 在欢迎界面全局设置设置一下 File 下面有import settings 选项:

Custsomize -> All settings ->

image

image

2、导入失败

image

❀ 解决:选择另外一种导入maven项目的方式:


三、版本2020.03 的idea 导入 项目

1、具体步骤:

File-> New -> Project from Existing Sources -> Project from Existing Sources -> Import project from external model -> 选择maven

2、导入maven 项目之后,进行刷新

image

image


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK