首页 > 其他分享 >自定义jar包的使用

自定义jar包的使用

时间:2022-10-29 16:33:51浏览次数:62  
标签:自定义 ag jar ctg SNAPSHOT 使用 2.5 sdk

1.先生成或者下载jar包到本地lib文件夹

2.通过命令把jar包加到本地maven仓库

命令把jar包加到本地maven仓库
mvn install:install-file -Dfile=ctg-ag-sdk-core-2.5.0-20220512.061430-51.jar -DpomFile=ctg-ag-sdk-core-2.5.0-20220512.061430-51.pom.xml
命令把jar包加到本地maven仓库
mvn org.apache.maven.plugins:maven-install-plugin:2.5.1:install-file -Dfile=ag-sdk-biz-142388.tar.gz-20221029.112453-SNAPSHOT.jar -DpomFile=ag-sdk-biz-142388.tar.gz-20221029.112453-SNAPSHOT.pom.xml

3.jar包上传到远程仓库的情况

<dependency>
<groupId>com.ctg.ag</groupId>
<artifactId>ctg-ag-sdk-core</artifactId>
<version>2.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.ctg.ag</groupId>
<artifactId>ag-sdk-biz-142388.tar.gz</artifactId>
<version>20221029.112453-SNAPSHOT</version>
</dependency>

4.jar未上传到远程仓库的情况

在项目上新建文件夹/src/main/resources/lib

使用maven引入自定义jar包   并指定jar包路径
<dependency>
<groupId>com.ctg.ag</groupId>
<artifactId>ag-sdk-biz-142388.tar.gz</artifactId>
<version>20221029.112453-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/ag-sdk-biz-142388.tar.gz-20221029.112453-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>com.ctg.ag</groupId>
<artifactId>ctg-ag-sdk-core</artifactId>
<version>2.5.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/ctg-ag-sdk-core-2.5.0-20220512.061430-51.jar</systemPath>
</dependency>

 

 

标签:自定义,ag,jar,ctg,SNAPSHOT,使用,2.5,sdk
From: https://www.cnblogs.com/1234cjq/p/16839002.html

相关文章