Access private github package registry (maven)

how can I download packages deployed to private package registries (same organization, other repositories) when using Java/maven with Github Codespaces?

Seems like this would require a custom maven settings.xml and setting up secrets (PATs as github packages do not recognize GITHUB_TOKEN for accessing other repositories in same org). However, I’ve not found any examples of how to make this work. The documentation only works with default, public repositories such as maven central. (Setting up your Java project for Codespaces - GitHub Docs)