IntelliJ IDEA中maven导入本地jar包

1. 打开cmd或者shell

2. 使用maven命令将本地jar包安装到maven的本地repository中:

mvn install:install-file -Dfile=/home/username/GLPKSolverPack.jar -DgroupId=com.leyantech.ai -DartifactId=glpk -Dversion=1.0 -Dpackaging=jar

3. 在项目的pom.xml文件中中加入相应的依赖

  1. <dependency>

  2. <groupId>com.leyantech.ai</groupId>

  3. <artifactId>glpk</artifactId>

  4. <version>1.0</version>

  5. </dependency>

4. 注意2和3中的groupId、artifactId、version保持一致

猜你喜欢

转载自blog.csdn.net/u012501054/article/details/82778272