Maven安装完成之后的配置
2016-04-22 00:00
435 查看
Maven安装完成之后,在conf/setting.xml中(可以把setting.xml复制到自己的用户目录下更改,以便每个用户的配置都能自定义) 1.配置本地仓库地址,从远程仓库下载的jar包会保存到这个目录,默认会在用户目录;建议自定义目录,方便管理:
<localRepository>/home/daniel/Tools/Maven/repo</localRepository>
2.在mirrors节点中添加远程仓库地址,可多个,以oschina的仓库为例: id, name是该镜像的唯一定义符。id用来区分不同的mirror元素。url是该镜像的URL。构建系统会优先考虑使用该URL,而非使用默认的服务器URL。 mirrorOf是被镜像的服务器的id。
例如,如果我们要设置了一个Maven中央仓库( http:// repo1.maven.org/maven2)的镜像,就需要将该元素设置成central。这必须和 中央仓库的id central完全一致。
<mirror>
<id>nexus-osc</id>
<mirrorOf>*</mirrorOf>
<name>Nexus osc</name>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
3.执行maven时还需要一些插件,下面时配置这些插件的下载地址,和maven默认JDK版本,在profiles节点添加profile
<profile>
<id>jdk1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<localRepository>/home/daniel/Tools/Maven/repo</localRepository>
2.在mirrors节点中添加远程仓库地址,可多个,以oschina的仓库为例: id, name是该镜像的唯一定义符。id用来区分不同的mirror元素。url是该镜像的URL。构建系统会优先考虑使用该URL,而非使用默认的服务器URL。 mirrorOf是被镜像的服务器的id。
例如,如果我们要设置了一个Maven中央仓库( http:// repo1.maven.org/maven2)的镜像,就需要将该元素设置成central。这必须和 中央仓库的id central完全一致。
<mirror>
<id>nexus-osc</id>
<mirrorOf>*</mirrorOf>
<name>Nexus osc</name>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
3.执行maven时还需要一些插件,下面时配置这些插件的下载地址,和maven默认JDK版本,在profiles节点添加profile
<profile>
<id>jdk1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
相关文章推荐
- java对世界各个时区(TimeZone)的通用转换处理方法(转载)
- java-注解annotation
- java-模拟tomcat服务器
- java-用HttpURLConnection发送Http请求.
- java-WEB中的监听器Lisener
- Android IPC进程间通讯机制
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 介绍一款信息管理系统的开源框架---jeecg
- 聚类算法之kmeans算法java版本
- java实现 PageRank算法
- PropertyChangeListener简单理解
- maven学习
- c++11 + SDL2 + ffmpeg +OpenAL + java = Android播放器
- 插入排序
- 冒泡排序
- 堆排序
- 快速排序