linux下maven项目中添加本地jar包

1. 导出jar包

2. 使用一下命令将jar包加入到maven仓库中

mvn install:install-file -Dfile=/home/hsp/Downloads/gmssldemo.jar -DgroupId=com.test.gmssl -DartifactId=gmssl-demo -Dversion=1.0 -Dpackaging=jar

其中: -Dfile: 对于你的jar包的位置   -DgroupId -DartifactId -Dversion三个参数分别对于pom.xml文件中的配置参数选项:如下所示:

<dependency>
        <groupId>com.test.gmssl</groupId>
        <artifactId>gmssl-demo</artifactId>
        <version>1.0</version>
      </dependency>

3. 如上在pom.xml中配置即可。

      

猜你喜欢

转载自blog.csdn.net/u014763678/article/details/83513521
今日推荐