新建目录my-lib,将jar包移动到目录中,添加pom文件(用alipay测试)
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.alipay</groupId> <artifactId>alipay-resource</artifactId> <version>1.0.0</version> <name>alipay</name> <description>alipay jar lib</description></project>cmd进入该目录下,执行命令
mvn install:install-file -Dfile=alipay-sdk-java20171201160035-source.jar -DgroupId=org.alipay -DartifactId=alipay-resource -Dversion=1.0.0 -Dpackaging=jar