Maven之Deploy使用

Maven之Deploy使用 背景 目前公司里的项目定制一般不需要用到Deploy(上传jar包到af仓库上),定制只是下载依赖然后使用。最近开发组件过程中,由于需要组件提供对外api给其它组件使用,在使用的过程中也不是特别顺利,所以记录一下Deploy的使用。 Deploy Deploy是Maven生命周期的最后一个环节,作用是上传最终的成果物到远程仓库中,共享给其它开发人员和工程。使用方法如下: Step 1:需要在settings.xml配置af仓库的用户名和密码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 <!-- servers | This is a list of authentication profiles, keyed by the server-id used within the system. | Authentication profiles can be used whenever maven must make a connection to a remote server. |--> <servers> <!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the 'id' attribute below). | | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are | used together. | --> <server> <id>xxx-release</id> <username>xxx</username> <password>xxx</password> </server> </servers> Step 2:要Deploy的module的pom文件中添加要上传的af仓库,id要和上面settings.xml中的id对应 ...

<span title='2023-06-21 18:40:34 +0800 +0800'>June 21, 2023</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;yuanpeng11