背景

有一些工程依赖的库是一些jar包,这些jar在公用仓储中没有,比如weibo的或weixin等等。

我们将这些jar包导入到工程中的本地仓储中,以便使maven可以正常依赖

目录规划

我们在项目中新建一个目录 “maven-repository ”做为仓储的存放地址。

导入jar到仓储中

在命令行中进入到工程根目录,执行如下命令

mvn deploy:deploy-file -Dfile=/yourpath/ojdbc14.jar  -DgroupId=com.oracle -DartifactId=ojdbc -Dversion=1.0 -Dpackaging=jar -Durl=file:./maven-repository/ -DrepositoryId=maven-repository -DupdateReleaseInfo=true

依赖

在pom.xml中加入仓储声明:

<repositories>
    <repository>
        <id>maven-repository</id>
        <url>file:///${project.basedir}/maven-repository</url>
    </repository>
</repositories>

依赖

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc</artifactId>
    <version>1.0</version>
</dependency>

results matching ""

    No results matching ""