将jar包发布(deploy)到maven仓库
1. 在Maven的settings.xml中配置仓库
在<services>…..</services> 中增加
<server>
<id>{仓库名}</id>
<username>{用户名}</username>
<password>{密码}</password>
</server>
2. maven上传命令
mvn deploy:deploy-file -DgroupId=com.xx.xx -DartifactId=xx -Dversion=1.0.0 -Dpackaging=jar -Dclassifier=sources -Dfile=xx-sources.jar -Durl=仓库地址 -DrepositoryId=仓库名
3. 示例
上传:
mvn deploy:deploy-file -DgroupId=org.ansj -DartifactId=ansj_seg -Dversion=2.0.8 -Dclassifier=min -Dpackaging=jar -Dfile=./ansj_seg-2.0.8-min.jar -Durl=http://{host}:{port}/nexus/content/repositories/thirdparty -DrepositoryId=thirdparty
在pom.xml中引用:
<dependency>
<groupId>org.ansj</groupId>
<artifactId>ansj_seg</artifactId>
<version>2.0.8</version>
<classifier>min</classifier>
</dependency>
上传:
mvn deploy:deploy-file -DgroupId=org.nlpcn -DartifactId=nlp-lang -Dversion=0.3 -Dpackaging=jar -Dfile=./nlp-lang-0.3.jar -Durl=http://{host}:{port}/nexus/content/repositories/thirdparty -DrepositoryId=thirdparty
在pom.xml中引用:
<dependency>
<groupId>org.nlpcn</groupId>
<artifactId>nlp-lang</artifactId>
<version>0.3</version>
</dependency>