转载自 link
步骤1
访问地址 ,点击Generate new token 创建新的token,选择权限 write:packages
步骤2
配置settings.xml ,添加配置, 修改用户名和password(这里写token)
<servers>
<server>
<id>github</id>
<username>fightinggg</username>
<password>TOKEN</password>
</server>
</servers>
步骤3
增加项目中的中央仓库, 注意修改url
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub fightinggg Apache Maven Packages</name>
<url>https://maven.pkg.github.com/fightinggg/maven-repository</url>
</repository>
</distributionManagement>
步骤4
增加项目的配置,选择github
<properties>
<github.global.server>github</github.global.server>
</properties>
步骤5
mvn clean deploy