= =在论坛看见人写,于是整理了下
1 直接写pom.xml在本地仓库中创建文件夹
例如:<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>1.1.1</version>
</dependency>
在本地仓库中创建javax\servlet\servlet-api\1.1\文件夹下添加jar
2
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>1.1.1</version>
- <scope>system</scope>
- <!--本地jar的路径,相对或者绝对都可以-->
- <systemPath>path/to/yourLocalJar.jar</systemPath>
- </dependency>
3 把jar安装到你本地协作的maven 资源库中
mvn deploy:deploy-file
-DgroupId=lotus.domino
-DartifactId=NCSO
-Dversion=7.0
-Dpackaging=jar
-Dfile=E:\dominosso\dominoapp\dominoapp\WEB-INF\lib\NCSO.jar
-Durl=http://yourlocalrepository:8888/archiva/repository/internal
-DrepositoryId=internal
把jar安装到你本地协作的maven 资源库中,不然你的同事检出这个maven 项目就惨了,因为TA 本地没有install 这个jar,所以必定会报缺少jar。
4
mvn install:install-file
-DgroupId=FCKeditor
-DartifactId=FCKeditor
-Dversion=2.3
-Dpackaging=jar
-Dfile=d:\FCKeditor-2.3.jar
相当与在pom.xml中添加了
<dependency>
<groupId>FCKeditor</groupId>
<artifactId>FCKeditor
</artifactId>
<version>2.3</version>
</dependency>