maven学习2
2015-08-18 23:21
253 查看
maven安装注意事项
修改maven本地仓库的默认存放路径修改setting.xml
settings.xml所造路径为:maven安装路径\conf\setting.xml,例如H:\java_develop\apache-maven-3.3.3-bin\apache-maven-3.3.3\conf\setting.xml). maven本地仓库默认目录为user.home,{user.home}是指“我的文档”。
<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 | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> -->
修改为本地其他目录,如下:
<localRepository>G:\maven\repository</localRepository>
同时,复制修改后的setting.xml至G:\maven\repository路径下
远程中央仓库设置
maven安装路径\lib\maven-model-builder-3.3.3.jar包中可以查看到远程中央仓库的地址。
打开pom-4.0.0.xml,如下代码片中URL标签即为中央仓库地址
<repositories> <repository> <id>central</id> <name>Central Repository</name> <url>https://repo.maven.apache.org/maven2</url> <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>
使用浏览器打开https://repo.maven.apache.org/maven2,可以查询到项目中所有依赖的第三方jar包。
maven骨架工具
由于maven项目的目录结构是固定的,由此可以通过mvn archetype命令创建maven工程
mvn archetype: generate -DgroupId=com.zch.maven -DartifactId=maven01 -Dversion=1.0-SNAPSHOT
eclipse中配置maven插件
参考如下链接中5~9步
http://jingyan.baidu.com/article/60ccbceb01de4d64cbb19756.html
相关文章推荐
- maven学习
- maven插件maven-war-plugin的使用
- maven使用经验集
- 使用maven+eclipse搭建struts2开发环境
- maven中下载jar包源码和javadoc的命令介绍
- Maven学习笔记
- Maven for Eclipse
- maven 使用 问题记录
- 《Maven权威指南》学习笔记四_创建一个简单的Maven项目
- 《Maven权威指南》学习笔记十七_一个多模块项目 3ff0
- 《Maven权威指南》学习笔记十八_多模块企业级项目 3ff0
- 《Maven权威指南》学习笔记二十_关于POM
- 近日maven学习概况
- Eclipse Maven Tomcat的利用配置
- (转)Vaadin 使用 Maven
- Maven和Eclipse联合开发
- Maven intall OR Maven build
- JFBlog 1.0 maven版本开源
- 使用Maven开发Android的常见问题
- XML中的特殊字符