Common stuff
1. Create or edit c:\user\<username>\.m2\settings.xml
At minimum should look like
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github-biz.daich</id>
<url>https://maven.pkg.github.com/BorisDaich/biz.daich</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<servers>
<server>
<id>github-biz.daich</id>
<username>BorisDaich</username>
<password>XXXXXXX</password>
</server>
<server>
<id>github-cmd-runner-rerunner</id>
<username>BorisDaich</username>
<password>XXXXXXX</password>
</server>
</servers>
</settings>
the password is something called Personal access tokens (classic)
for every repository on github here should be a separate <server> section
<repository>
<id>github-biz.daich</id>
<url>https://maven.pkg.github.com/BorisDaich/biz.daich</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
How to use a dependency from GitHub Artifact Repo
<repositories>
<repository>
<id>github-biz.daich</id>
<url>https://maven.pkg.github.com/BorisDaich/biz.daich</url>
</repository>
<repository>
<id>github-cmd-runner-rerunner</id>
<url>https://maven.pkg.github.com/BorisDaich/cmd-runner-rerunner</url>
</repository>
</repositories>
How to publish a project to a repository
<distributionManagement>
<repository>
<id>github-{GitHubRepositoryName}</id>
<url>https://maven.pkg.github.com/BorisDaich/{GitHubRepositoryName}</url>
</repository>
</distributionManagement>
notice that you need to replace {GitHubRepositoryName}
and make sure that in the settings.xml you have <server> section with this ID
No comments:
Post a Comment