Maven 安装与Eclipse搭建
来源:互联网 发布:ubuntu文件系统 编辑:程序博客网 时间:2024/05/09 05:16
下载maven可以到:http://maven.apache.org/
Maven的eclipse基本使用可以在这里看到:http://www.iteye.com/topic/1123225
1、把下载下来的maven的zip文件随便解压到一个地方,比如:E:\apache-maven-3.3.9
2、设置环境变量(雷同JAVA_HOME):
新加一个"M2_HOME":
把"MAVEN"加到Path中:
3、打开命令行comand 看看maven是否已经正确配置:
mvn -v
能看到上面的信息说明已经配置正常。
4、在命令行中输入:
mvn help:system
此命令运行完后,将会在windows用户文件夹自动生成一个“.m2”的文件夹,里头有一个repository目录,比如:
C:\Users\xxxxx\.m2
这是本地用户仓库,未来使用maven所自动下载的jar包会下载到这。
5、设置私服
有些公司会架构私服,我们要配置maven的一些设置。
以自己的maven环境为例,打开E:\apache-maven-3.3.9\conf\settings.xml文件,配置一些信息:
(1):配置本地仓库:
<!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ~/.m2/repository <localRepository>~/.m2/repository</localRepository> --> <localRepository>E:\maven\repo</localRepository>(2):配置私服:
<?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>E:\maven\repo</localRepository> <pluginGroups> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups> <servers> <server><id>releases</id><username>admin</username><password>admin123</password></server><server><id>snapshots</id><username>admin</username><password>admin123</password></server><server> <id>thirdparty</id> <username>admin</username> <password>admin123</password> </server> </servers> <mirrors> <mirror> <!--This sends everything else to /public --> <id>nexus</id> <name>nexus</name> <url>http://repo1.maven.org/maven2/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <!--This sends everything else to /public --> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://Ip地址:端口/nexus/content/groups/public/</url> </mirror> </mirrors> <profiles><profile> <id>nexus</id> <activation> <activeByDefault>true</activeByDefault> </activation> <repositories> <repository> <id>snapshots</id> <name>Snapshots</name> <url>http://Ip地址:端口/nexus/content/repositories/snapshots</url> </repository> <repository> <id>releases</id> <name>Releases</name> <url>http://Ip地址:端口/nexus/content/repositories/releases</url> </repository> <repository> <id>thirdparty</id> <name>thirdparty</name> <url>http://Ip地址:端口/nexus/content/repositories/thirdparty</url> </repository> <repository> <id>central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles><activeProfile>nexus</activeProfile></activeProfiles></settings>
6、Eclipse配置Maven:
点击eclipse中的window->Perference->Maven->Installations,设置自己下载的Maven。
点击add添加自己的maven,原eclipse自带的maven可移除,因为大多是版本不一样,会导致后面有莫名的问题。
在user settings选择自己maven的setting,最后还要点击 “update settings” ,不然eclipse可能没有读取到这个setting。
- Maven安装与Eclipse搭建
- [Maven] - 安装与Eclipse搭建
- [Maven] - 安装与Eclipse搭建
- Eclipse:maven安装与搭建
- [Maven] - 安装与Eclipse搭建
- Maven 安装与Eclipse搭建
- 【JAVA】MAVEN安装与Eclipse搭建
- maven安装,与eclipse搭建步骤
- Maven的搭建安装与eclipse的结合
- maven环境搭建、Eclipse安装
- maven搭建与eclipse配置
- Maven与Eclipse集成安装
- Maven安装与Eclipse集成
- Java eclipse安装和maven环境搭建
- 开发环境搭建(安装Tomcat、eclipse、maven)
- Maven环境的搭建&&Maven Eclipse插件的安装
- maven系列一 —— maven环境搭建、Eclipse安装
- Maven环境搭建+eclipse中安装Maven插件
- 浅谈JVM的实现与垃圾回收机制
- 113. Path Sum II
- Android 6.0动态权限申请--事例代码
- LPC中Fixed linear predictor的详细说明
- 2016年 中国大学生程序设计竞赛合肥赛区(ccpc)解题报告
- Maven 安装与Eclipse搭建
- intellij idea 初识,Hello Idea!!
- (文章非原创)solr集群搭建和 java调用 solr集群
- C++学习第二课笔记
- HTML5--服务器发送事件
- 高性能MySQL读书笔记:1、MySQL架构与历史
- linux中编译c和c++
- Java之最大堆内存设置(-Xmx)
- [kuangbin带你飞]专题四 最短路练习 K(差分约束)L