Maven环境搭建

本文详细介绍了如何搭建Maven环境,包括下载Maven、配置环境变量、设置本地仓库等步骤,并指导如何通过IDEA新建一个Maven Web项目。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一:环境搭建

1.首先从maven官网下载Apache Maven3.3.9,下载后找放一个安装目录。

2.配置环境变量:如图是我maven存放的路径



3.如何检测环境有没有搭建好:

执行cmd命令:mvn -version 回车

如图所示:就代表环境已经搭建好,




4.需要下载Maven 仓库Repository,它存放的是基本开发所用到的jar包,下载后放入盘符,

找到下载好的apache-maven-3.3.9下面的conf目录下面的settings,并打开,修改本地仓库存放路径。

如图:



以上4步已经完成了基本工作,环境已经搭建成功配置成功。

二:下面我们来新建一个maven项目

1.点击File\new一个maven项目


2.Next下一步


3.选中maven-archetype-webapp,点击next.


4.填写Group Id和Artifact Id,点击finish即可。


项目建好后如图所示,很明显项目报错:


此时我们需要把右击项目属性Properties


把勾号去掉再勾上,apply,点击ok即可。

如下图所示,完整的一个maven项目就建好啦微笑


要注意的是如果 

Maven新建webapp项目index.jsp报错,不用方,在本博主上篇文章有解决方案哦~~~~

希望本篇博客有帮到亲们~谢谢!


Apache Maven What is it? ----------- Maven is a software project management and comprehension tool. Based on the concept of a Project Object Model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. Documentation ------------- The most up-to-date documentation can be found at http://maven.apache.org/. Release Notes ------------- The full list of changes can be found at http://maven.apache.org/release-notes.html. System Requirements ------------------- JDK: 1.7 or above (this is to execute Maven - it still allows you to build against 1.3 and prior JDK's). Memory: No minimum requirement. Disk: Approximately 10MB is required for the Maven installation itself. In addition to that, additional disk space will be used for your local Maven repository. The size of your local repository will vary depending on usage but expect at least 500MB. Operating System: Windows: Windows 2000 or above. Unix based systems (Linux, Solaris and Mac OS X) and others: No minimum requirement. Installing Maven ---------------- 1) Unpack the archive where you would like to store the binaries, eg: Unix-based operating systems (Linux, Solaris and Mac OS X) tar zxvf apache-maven-3.x.y.tar.gz Windows unzip apache-maven-3.x.y.zip 2) A directory called "apache-maven-3.x.y" will be created. 3) Add the bin directory to your PATH, eg: Unix-based operating systems (Linux, Solaris and Mac OS X) export PATH=/usr/local/apache-maven-3.x.y/bin:$PATH Windows set PATH="c:\program files\apache-maven-3.x.y\bin";%PATH% 4) Make sure JAVA_HOME is set to the location of your JDK 5) Run "mvn --version" to verify that it is correctly installed. For complete documentation, see http://maven.apache.org/download.html#Installation Licensing --------- Please see the file called LICENSE.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值