将下载到本地的JAR包手动添加到Maven仓库

常用Maven仓库网址:
http://mvnrepository.com/
http://search.maven.org/
http://repository.sonatype.org/content/groups/public/
http://people.apache.org/repo/m2-snapshot-repository/
http://people.apache.org/repo/m2-incubating-repository/

mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=项目设置的groupId(参数二) -DartifactId=项目设置的artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar

例如: 将桌面的connector-java-5.1.44.jar导入maven仓库

mvn install:install-file -Dfile=C:UsersAdministratorDesktopmysql-connector-java-5.1.44.jar -DgroupId=com.xwb -DartifactId=hellowmaven -Dversion=5.1.44 -Dpackaging=jar

原文地址:https://www.cnblogs.com/insist-bin/p/11217459.html