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>