1. 程式人生 > >linux下maven專案中新增本地jar包

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中配置即可。