1.环境变量添加:
MAVEN_HOME:(maven位置)
M2_HOME:(maven位置)
PATH:%M2_HOME%\bin
(验证maven是否配置成功cmd–>mvn -version(或者 mvn -v))
2.安装sdk到本地仓库
将alipay-sdk-java20170307171631.jar放在e:下,cmd进入e:输入下面的命令:
mvn install:install-file -DgroupId=com.alipay -DartifactId=sdk-java -Dversion=20170307171631 -Dpackaging=jar -Dfile=alipay-sdk-java20170307171631.jar
3.pom中添加
<dependency>
<groupId>com.alipay</groupId>
<artifactId>sdk-java</artifactId>
<version>20170307171631</version>
</dependency>
以上ok!
将jar上传到远程私服仓库,类似:
mvn deploy:deploy-file
-Dfile=F:\MyEclipse\upload-repository\upload-repository-0.0.1-SNAPSHOT.jar -DgroupId=com.dcf.core.demo
-DartifactId=upload-repository
-Dversion=0.0.1-SNAPSHOT -Durl=http://192.168.14.217:9091/nexus/content/repositories/snapshots/
-Dpackaging=jar-DrepositoryId=nexus-snapshots