阿里云仓库:https://maven.aliyun.com/mvn/search
阿里云远程服务镜像:
<mirrors> <id> nexus-aliyun</id> <mirrorOf>*</mirrorOf> <name>Nexus aliyun </name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirrors>
将jar包打到本地仓库:
mvn install:install-file -DgroupId=com.aliyun -DartifactId=aliyun-java-sdk-dysmsapi -Dversion=1.0.0 -Dpackaging=jar -Dfile=alipay-trade-sdk-1.0.0.jar
私服:
需要在 maven 软件的核心配置文件 settings.xml 中配置第三方仓库的 server 信息
<server>
<id>thirdparty</id>
<username>admin</username>
<password>admin123</password>
</server>
才能执行一下命令
mvn deploy:deploy-file -DgroupId=com.alibaba -DartifactId=fastjson -Dversion=1.1.37
-Dpackaging=jar -Dfile=fastjson-1.1.37.jar
-Durl=http://localhost:8081/nexus/content/repositories/thirdparty/
-DrepositoryId=thirdparty
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.0.6</version>
</dependency>