maven配置

xiaoxiao2021-02-28  117

版本号更新

通过maven插件更新version(所有模块):

mvn versions:set -DnewVersion=2.6.0-SNAPSHOT

即将所有模块(包括parent)版本号更新为2.6.0-SNAPSHOT

上传本地jar到远程仓库

export groupId='com.caucho' export artifactId='hessian' export version='4.0.38.bigdecimal' mvn deploy:deploy-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dfile=${artifactId}-${version}.jar -DpomFile=${artifactId}-${version}.pom -Durl=http://a.b.c/repository/thirdparty/ -DrepositoryId=thirdparty

上面是指定了pom文件。如果没有pom 则不需要传入-DpomFile 这个参数。此时或默认生成一个pom文件

mvn deploy:deploy-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dfile=${artifactId}-${version}.jar -Durl=http://a.b.c/repository/thirdparty/ -DrepositoryId=thirdparty

指定settings配置文件执行mvn命令

如上面的mvn指令执行如下:

mvn deploy:deploy-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dfile=${artifactId}-${version}.jar -Durl=http://a.b.c/repository/thirdparty/ -DrepositoryId=thirdparty --settings "D:\sdk\maven\apache-maven-3.5.2\conf\my_settings.xml"
转载请注明原文地址: https://www.6miu.com/read-34485.html

最新回复(0)