IDEA导入maven项目压缩包

当我们收到一份IDEA的maven工程压缩包我们该如何使其在我们自己的IDEA上运行起来?

首先我们需要在自己的电脑上下载maven,并配置好环境。

首先我们先解压缩该文件

然后使用IDEA打开

image-20250121205749034

点击信任项目

接下来我们逐步进行

1.修改maven设置

image-20250121203134453

将主路径,用户设置文件修改为自己的。

image-20250121203241975

应用确定即可

2.修改maven设置文件中的源路径

找到对应路径文件,使用记事本打开。

"C:\HHHH\maven\apache-maven-3.6.3\conf\settings.xml"

查找mirrors关键字,你会看到如下内容,我这个是我已经修改过的了。

<!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
   ##这是一大段注释
   
##在这个字段内修改<mirror>的内容即可
<mirrors>

##这是阿里云的地址
<mirror>
    <id>aliyun</id>
    <name>Aliyun Maven Repository</name>
    <url>https://maven.aliyun.com/repository/public</url>
    <mirrorOf>central</mirrorOf>
    <blocking>false</blocking>
</mirror>

</mirrors>

image-20250121203718495

3.配置jdk,修改为可用jdk即可

image-20250121210049947

image-20250121210115313

image-20250121210152696

4.依次点击clean,compile,package。下载补全缺失项

image-20250121204149767

点击clean

image-20250121210739378

点击compile,缺失项会开始下载,由于我们设置的是阿里云,因此下载地址是阿里云。

image-20250121210817387

点击package

image-20250121211014772

经过这3步基本上缺失的都会下载好,如图已经不标红了

image-20250121210708430

5.注意pom.xml文件是否有标红

如图,我们可以删除掉2后面的".“然后再打上”.",IDEA会跳出它有的提示,我们选取一个即可

image-20250121211222226

image-20250121211245850

运行结果

image-20250121211522688

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值