Fork me on GitHub

Spring日记_01 之 Maven搭建 - 阿里云镜像替换maven配置文件

# 项目环境搭建

## 1. Eclipse + Maven

中央库太慢所以使用     阿里云镜像:maven.aliyun.com

 

1. 配置Aliyun Maven 仓库

导入配置文件  settings.xml

Window – Preferences – Maven – User Settings - Global Settings 选择settings.xml

 

附:settings.xml

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

	<localRepository>F:/maven</localRepository>

	<pluginGroups>
	</pluginGroups>

	<proxies>
	</proxies>

	<servers>
	</servers>

	<mirrors>
		<mirror>
			<id>nexus</id>
			<name>Tedu Maven</name>
			<mirrorOf>*</mirrorOf>
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
			<!-- <url>http://maven.aliyun.com/content/groups/public</url> -->
		</mirror>
	</mirrors>
	<profiles>

	</profiles>
	<activeProfiles>
	</activeProfiles>

</settings>

 

完成之后 F:/maven 路径下会生成maven库

 

 2. 创建项目测试Maven

 

 

 

补充:

关于Maven

 

  1. 在开发中,为了保证编译通过,我们会到处去寻找jar包,当编译通过了,运行的时候,却发现"ClassNotFoundException",我们想到的是,难道还差jar包?
  2. 每个Java项目的目录结构都没有一个统一的标准,配置文件到处都是,单元测试代码到底应该放在那里也没有一个权威的规范。
  3. 因此,我们就要用到Maven(使用Ant也可以,不过编写Ant的xml脚本比较麻烦)----一个项目管理工具
  4. Maven主要做了两件事:

 

  • 统一开发规范与工具
  • 统一管理jar包

 

https://www.cnblogs.com/hongwz/p/5456578.html

 

posted @ 2017-08-22 13:18  RongT  阅读(638)  评论(0编辑  收藏  举报