jar文件需要放到当前目录下,执行以下命令,设置 groupId,artifactId,version信息,方便项目pom引用

mvn install:install-file -Dfile=xxx.jar -Dpackaging=jar -DgroupId=xxx -DartifactId=xxx -Dversion=x

执行完毕,即可把jar装载到本地仓库,项目中可直接使用引入依赖

如sqljdbc

mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0

pom.xml在 dependencies 节点加入(需要与之前install的groupId等信息一致)

<dependency>

    <groupId>com.microsoft.sqlserver</groupId>

    <artifactId>sqljdbc4</artifactId>

    <version>4.0</version>

</dependency>

相关文章:

  • 2021-09-25
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2022-02-24
  • 2022-12-23
猜你喜欢
  • 2021-07-09
  • 2021-09-14
  • 2021-05-24
  • 2021-05-22
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案