做内贸的网站,网站建设 常用字体,网页版qq登录入口版qq账号登录界面,网络舆情软件免费入口参考博客#xff1a;将组件发布到maven中央仓库-CSDN博客 感谢这位博主。但是他的步骤有漏缺#xff0c;相对进行补充 访问管理页面
网址#xff1a;Maven Central 新注册账号#xff0c;或者使用github快捷登录#xff0c;建议使用github快捷登录 添加命名空间 注意将组件发布到maven中央仓库-CSDN博客 感谢这位博主。但是他的步骤有漏缺相对进行补充 访问管理页面
网址Maven Central 新注册账号或者使用github快捷登录建议使用github快捷登录 添加命名空间 注意如果使用github快捷登录默认携带 io.github.?? 的命名空间如果自己的代码在github上可以直接使用这个命名空间 如果代码在 码云 仓库 提交后提示需要验证空间需要按照要求到 码云 仓库创建一个对应名称的空内容的项目然后点击认证。
如上图 io.gitee.wsitm 是我的命名空间 添加其他命名空间见 Register a Namespace - The Central Repository Documentation 创建代码仓库 注意代码一定需要符合开源可以使用MIT开源或其他开源。创建开源极为容易gitee默认会提示创建开源有快捷入口点击快速创建。 代码的pom.xml的配置 具体如下 ?xml version1.0 encodingUTF-8?
project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersiongroupIdio.gitee.wsitm/groupIdartifactIdwsitm-clutter/artifactIdversion0.0.1/versionurlhttps://gitee.com/wsitm/wsitm-clutter.git/urlpackagingjar/packagingname${project.artifactId}/namedescriptionwsitm-clutter杂烩工具/descriptiondependencies/dependencieslicenseslicensenameMIT License/nameurlhttps://opensource.org/licenses/MIT/urlcommentsThe project itself is licensed under MIT License./comments/license/licensesdevelopersdevelopernameyourname/nameemailyouremailqq.com/email/developer/developersscmconnectionscm:gitgitee.com:wsitm/wsitm-clutter.git/connectiondeveloperConnectionscm:gitgitee.com:wsitm/wsitm-clutter.git/developerConnectionurlhttps://gitee.com/wsitm/wsitm-clutter.git/url/scmbuildpluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-source-plugin/artifactIdversion3.3.0/versionexecutionsexecutionidattach-sources/idgoalsgoaljar-no-fork/goal/goals/execution/executions/pluginplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-javadoc-plugin/artifactIdversion2.9.1/versionconfigurationaggregatetrue/aggregatecharsetUTF-8/charsetencodingUTF-8/encodingdocencodingUTF-8/docencodingadditionalparam-Xdoclint:none/additionalparam/configurationexecutionsexecutionidattach-javadocs/idgoalsgoaljar/goal/goals/execution/executions/pluginplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-gpg-plugin/artifactIdversion3.1.0/versionexecutionsexecutionidsign-artifacts/idphaseverify/phasegoalsgoalsign/goal/goals/execution/executions/plugin!--maven插件--plugingroupIdorg.sonatype.central/groupIdartifactIdcentral-publishing-maven-plugin/artifactIdversion0.4.0/versionextensionstrue/extensionsconfigurationpublishingServerIdcentral/publishingServerIdtokenAuthtrue/tokenAuth/configuration/plugin/plugins/build
/project生成GPG密钥
作用这是用于给自身源码加签名 下载GPG管理软件https://gnupg.org/download/index.html 点击进入下载页面 如上图当然如果有钱也可以捐献一些。我不一样我白嫖 安装完成之后使用命令生成密钥命令: gpg –gen-key 生成之后 推送密钥到远程服务端
命令: gpg --keyserver hkp://keyserver.ubuntu.com --send-keys [生成密钥后的标识]
例子gpg --keyserver hkp://keyserver.ubuntu.com --send-keys 2*************F6449 服务--keyserver 有三个官方网址可以切换
keyserver.ubuntu.comkeys.openpgp.orgpgp.mit.edu 注意可能推送不成功三个网址我都测试不成功不知道什么原因只能使用另一种方法 公钥如下 复制全部内容手动上传打开服务网址: https://keyserver.ubuntu.com/# 生成token 得到的token格式如下 maven的setting.xml的配置 具体如下 ?xml version1.0 encodingUTF-8?
settings xmlnshttp://maven.apache.org/SETTINGS/1.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsdserversserveridcentral/idusername${tokenId}/usernamepassword${tokenPass}/password/server/serversprofilesprofileidgpg/idpropertiesgpg.executablegpg/gpg.executablegpg.keynameyouremailqq.com/gpg.keynamegpg.passphrase${pgp-password}/gpg.passphrasegpg.useagenttrue/gpg.useagent/properties/profile/profiles
/settings发布到仓库
进入代码目录执行命令: mvn clean deploy
发布完成打开管理页面 提交后需要验证如果正常 如果异常查看错误描述 去仓库查看自己的项目
阿里云: 仓库服务 官方: Central Repository: 官方页面https://mvnrepository.com/ 注阿里云和官方能在审核后1小时内能查到自己的项目但是官方页面需要好多天才能查询。但直接在maven中引用即可并不影响使用