maven的几个基本的操作

Posted on 2018-02-06 10:50  谷臻  阅读(228)  评论(0)    收藏  举报

前提要在本地安装maven

手动添加JAR包到本地MAVEN仓库

  <dependency>
  <groupId>1</groupId>
  <artifactId>2</artifactId>
  <version>3</version>
  </dependency>

  mvn install:install-file -Dfile=F:\mvn\路径.jar -DgroupId=1 -DartifactId=2-Dversion=3 -Dpackaging=jar

出现这个说明添加成功

 

在eclipse 或者myeclipse 中的maven包到出到本地 

1、打开windows的dos命令界面

2、进入项目的pom.xml文件所在目录

3、输入:mvn dependency:copy-dependencies -DoutputDirectory=F:\lib -DincludeScope=compile

       -DoutputDirectory=F:\lib  如果lib这个文件夹不存在会直接创建