1、安装maven,例如安装路径 D:\jianing\ToolsInstallation\Java开发工具\apache-maven-2.2.1
2、在环境变量里配置maven路径,(Win7)控制面板->用户账户->更改我的环境变量->系统环境:建立环境变量MAVEN_HOME,赋值:D:\jianing\ToolsInstallation\Java开发工具\apache-maven-2.2.1
3、在文件夹D:\jianing\ToolsInstallation\Java开发工具\apache-maven-2.2.1\conf里设置setting.xml文件的内容,根据maven服务器的信息进行配置,内容如下:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
false
central
libs-releases
http://artifactory.xxx-develop.com/libs-releases
snapshots
libs-snapshots
http://artifactory.xxx-develop.com/libs-snapshots
false
central
plugins-releases
http://artifactory.xxx-develop.com/plugins-releases
snapshots
plugins-snapshots
http://artifactory.xxx-develop.com/plugins-snapshots
artifactory
artifactory
4、在IDEA 里设置setting.xml配置路径,File -> Settings -> Maven ->User settings file: "D:\jianing\ToolsInstallation\Java开发工具\apache-maven-2.2.1\conf\settings.xml"
编译: 右边Maven Projects -> Profiles下面,勾选 artifactory 和 dev-publish, 只需要clean和compile 项目PROJECTname(root)即可。