手动将jar添加到maven仓库中

时间:2023-03-08 22:51:40
手动将jar添加到maven仓库中


1.将jar放到E:\workspace\lib中。如下图:

手动将jar添加到maven仓库中

2.编写pom.xml文件,定义jfinal的坐标。

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.jfinal</groupId>

<artifactId>jfinal</artifactId>

<version>2.0</version>

<packaging>jar</packaging>

<name>jfinal</name>

<description>jfinal</description>

</project>

3.如果要想将jfinal-2.0-bin.jar手动添加到仓库,需要执行如下命令:

E:\workspace\lib>mvn install:install-file -Dfile=jfinal-2.0-bin.jar -DgroupId=co

m.jfinal -DartifactId=jfinal -Dversion=2.0 -Dpackaging=jar

手动将jar添加到maven仓库中

4.查看maven仓库中的变化:

手动将jar添加到maven仓库中

5.手动导入其它jar的方式:

(1)、将ojdbc14-10.2.0.4.jar导入到maven仓库中

E:\workspace\lib>mvn install:install-file -Dfile=ojdbc14-10.2.0.4.jar -DgroupId=

com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar

(2)、将cglib-nodep-3.1.jar导入到maven仓库中

E:\workspace\lib>mvn install:install-file -Dfile=cglib-nodep-3.1.jar -DgroupId=cglib -DartifactId=cglib-nodep -Dversion=3.1 -Dpackaging=jar

(3)、将jetty-server-8.1.8.jar导入到maven仓库中

E:\workspace\lib>mvn install:install-file -Dfile=jetty-server-8.1.8.jar -DgroupId=com.jfinal -DartifactId=com -Dversion= 26Dec2008 -Dpackaging=jar

(4)、将cos-26Dec2008.jar导入到maven仓库中

E:\workspace\lib>mvn install:install-file -Dfile=cos-26Dec2008.jar -DgroupId= org.beetl -DartifactId=cglib-nodep -Dversion=3.1 -Dpackaging=jar

(5)、将beetl-core-2.2.4.jar导入到maven仓库中

E:\workspace\lib>mvn install:install-file -Dfile=beetl-core-2.2.4.jar -DgroupId=org.beetl -DartifactId=beetl-core -Dversion=2.2.3 -Dpackaging=jar