(1)Intellij + Maven 创建Spring项目

初学spring,发现开发中要下载各种jar包很烦,用Maven可以解决烦恼,于是花了两小时才配置好,中间遇到不少问题,现记录下来。

1. 下载Maven

这里我下的是3.0.5,由于我intellij版本是14的,不是很高,一开始下载了3.5的Maven结果工程木有目录

2. 配置Maven的环境变量

(1)Intellij + Maven 创建Spring项目_第1张图片
image.png

;%MAVEN_HOME%\bin;


(1)Intellij + Maven 创建Spring项目_第2张图片
image.png

3. Intellij配置Maven 在ohterSetting也要设置哦 设置两遍

(1)Intellij + Maven 创建Spring项目_第3张图片
image.png
(1)Intellij + Maven 创建Spring项目_第4张图片
image.png

4. Maven conf下Settings.xml文件修改

(1)Intellij + Maven 创建Spring项目_第5张图片
image.png
 
        
            alimaven
            central
            aliyun maven
            http://maven.aliyun.com/nexus/content/repositories/central/
        
    
        
        
            repo1
            central
            Human Readable Name for this Mirror.
            http://repo1.maven.org/maven2/
        
    
        
        
            repo2
            central
            Human Readable Name for this Mirror.
            http://repo2.maven.org/maven2/
        
(1)Intellij + Maven 创建Spring项目_第6张图片
image.png

5. New Maven webapp项目加载缓慢解决

在maven的VM Options加上-DarchetypeCatalog=internal参数,如下:

(1)Intellij + Maven 创建Spring项目_第7张图片
Paste_Image.png
(1)Intellij + Maven 创建Spring项目_第8张图片
Paste_Image.png

6. New Maven webapp项目后 要去配置一下

(1)Intellij + Maven 创建Spring项目_第9张图片
image.png

暂时就这样吧 由于我是初学者,后续有啥再补充

你可能感兴趣的:((1)Intellij + Maven 创建Spring项目)