Fyi, you can also have this right inside a pom.xml
, by adding such a “public access token” right into the repo URL:
<repository>
<id>github</id>
<!-- Basic auth via access token with `read:packages` scope -->
<url>https://anon:READ_PACKAGES_TOKEN@maven.pkg.github.com/example/*</url>
</repository>
Edit: Well, while it works locally, apparently the token is still redacted on GitHub Actions.