java项目,配置maven,编译项目
2013-11-27 14:39
363 查看
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服务器的信息进行配置,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-releases</name>
<url>http://artifactory.xxx-develop.com/libs-releases</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshots</name>
<url>http://artifactory.xxx-develop.com/libs-snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-releases</name>
<url>http://artifactory.xxx-develop.com/plugins-releases</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshots</name>
<url>http://artifactory.xxx-develop.com/plugins-snapshots</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
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)即可。
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服务器的信息进行配置,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-releases</name>
<url>http://artifactory.xxx-develop.com/libs-releases</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshots</name>
<url>http://artifactory.xxx-develop.com/libs-snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-releases</name>
<url>http://artifactory.xxx-develop.com/plugins-releases</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshots</name>
<url>http://artifactory.xxx-develop.com/plugins-snapshots</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
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)即可。
相关文章推荐
- Java maven项目编译漏掉src/main/java下的xml配置文件
- 分享知识-快乐自己:IDEA下maven编译打包Java项目成jar包但是resource下配置文件无法编译
- maven项目编译漏掉src/main/java下的xml配置文件
- maven项目编译漏掉src/main/java下的xml配置文件
- IDEA下maven编译打包Java项目成jar包但是resource下配置文件打包不成功
- [置顶] 【JAVA】Maven项目配置jdk版本以及tomcat插件的代码
- Eclipse maven webapp项目目录结构配置 java build path 出现问题
- Spring Mybatis Maven 项目搭建(Java配置)
- 配置java的maven项目下的ssh框架
- Java Maven项目的关键参数配置到pom文件的方法
- windows下使用maven-3.3.9编译java项目生成jar
- 解决idea用maven创建java项目代码无法编译的问题
- 针对非maven模式的JAVA项目进行sonar-runner配置
- hjr-JAVA:J2EE Maven项目环境配置
- Maven项目在Eclipse中自动编译“java heap space”
- maven项目install时候一直报错,检查Maven-javadoc-plugin声明错误(Java 8 配置Maven-javadoc-plugin)
- eclipse下maven项目构建后src/test/java下的java文件始终是处于未编译状态的处理
- java项目配置maven仓库阿里云镜像
- Maven的安装配置及初次创建项目与java单元测试工具JUnit
- IDEA用maven创建springMVC项目和配置(XML配置和Java配置)